default 404 message

14 views
Skip to first unread message

Valeriy Filatov

unread,
Aug 12, 2013, 4:19:56 PM8/12/13
to perl...@googlegroups.com
I found if you change
modules      => [qw/Template JSON Logger/]
$ telnet 127.1 5000
Trying 127.0.0.1...
Connected to 127.1.
Escape character is '^]'.
GET /123 HTTP/1.0

HTTP/1.0 404 Not Found
Date: Mon, 12 Aug 2013 20:18:48 GMT
Server: HTTP::Server::PSGI
Content-Type: text/html; charset=UTF-8
X-Framework: Perl Kelp
Content-Length: 20

404 - File Not FoundConnection closed by foreign host.

to
modules      => [qw/Template::Toolkit JSON Logger/]

It stops rendering default 404 message.

$ telnet 127.1 5000
Trying 127.0.0.1...
Connected to 127.1.
Escape character is '^]'.
GET /123 HTTP/1.0

HTTP/1.0 404 Not Found
Date: Mon, 12 Aug 2013 20:15:44 GMT
Server: HTTP::Server::PSGI
Content-Type: text/html; charset=UTF-8
X-Framework: Perl Kelp
Content-Length: 0

Connection closed by foreign host.

Stefan Geneshky

unread,
Aug 12, 2013, 6:36:14 PM8/12/13
to perl...@googlegroups.com
This is because Template::Toolkit can not find your templates. You have to add the path to the module configuration:

{
    modules => ['Template::Toolkit'],
    modules_init => {
        'Template::Toolkit' => {
            INCLUDE_PATH => 'views'
        }
    }
};

Stefan

Valeriy Filatov

unread,
Aug 12, 2013, 6:42:27 PM8/12/13
to perl...@googlegroups.com

Actually the PATH is in config.pl but the is no 404 template by default.

Stefan Geneshky

unread,
Aug 12, 2013, 6:44:02 PM8/12/13
to perl...@googlegroups.com
You error templates have to be in views/error/, for example views/error/404.tt, views/error/500.tt, etc.

Valeriy Filatov

unread,
Aug 12, 2013, 6:47:05 PM8/12/13
to perl...@googlegroups.com

Thanks!

Reply all
Reply to author
Forward
0 new messages