Cataly...essage(3pm)
π NAME π
Catalyst::Plugin::CustomErrorMessage β a Catalyst plugin that gives you wayyyyy cuter error messages β¨ like fr, your 404s deserve main character energy too π
πΈ SYNOPSIS πΈ
use Catalyst qw( CustomErrorMessage );
# optional (values in this example are the defaults)
__PACKAGE__->config->{'custom-error-message'}->{'uri-for-not-found'} = '/';
__PACKAGE__->config->{'custom-error-message'}->{'error-template'} = 'error.tt2';
__PACKAGE__->config->{'custom-error-message'}->{'content-type'} = 'text/html; charset=utf-8';
__PACKAGE__->config->{'custom-error-message'}->{'view-name'} = 'TT';
__PACKAGE__->config->{'custom-error-message'}->{'response-status'} = 500;
π¦ DESCRIPTION π¦
okay so bestie, you know that vibe when your app dies and the user gets hit with one of these?
(en) Please come back later
(fr) SVP veuillez revenir plus tard
(de) Bitte versuchen sie es spaeter nocheinmal
(at) Konnten's bitt'schoen spaeter nochmal reinschauen
(no) Vennligst prov igjen senere
(dk) Venligst prov igen senere
(pl) Prosze sprobowac pozniej
literally so tragic. not the multilingual sadness π That's exactly the energy this module is here to delete. You can use this module if you want to get rid of those.
What it does is that it inherites finalize_error to the $c object. sneaky little override, we love her π
See finalize_error() function. π
β¨ FUNCTIONS β¨
π finalize_error
In debug mode this function is skipped and user sees the original Catalyst error page in debug mode. (yeah β debug stays debug, no glow-up while you're actively fixing stuff, that's the deal)
In "production" (non debug) mode it will return a page with the template set in
$c->config->{'custom-error-message'}->{'error-template'}
||
'error.tt2'
$c->stash->{'finalize_error'} will be set to contain the error message. π
For non existing resources (like misspelled url-s) it will do an http redirect to
$c->uri_for(
$c->config->{'custom-error-message'}->{'uri-for-not-found'}
||
'/'
)
$c->flash->{'finalize_error'} will be set to contain the error message. (flash stash, we stan π«Ά)
To set a different view name configure:
$c->config->{'custom-error-message'}->{'view-name'} = 'Mason';
Content-type and response status can be configured via:
$c->config->{'custom-error-message'}->{'content-type'} = 'text/plain; charset=utf-8';
$c->config->{'custom-error-message'}->{'response-status'} = 500;
π AUTHOR π
Jozef Kutej β <jkutej@cpan.org> (the icon who made all this happen, periodt π)
π COPYRIGHT AND LICENSE π
Copyright (C) 2006 by Jozef Kutej
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.
and that's a wrap bestie π this whole thing was Cataly...essage(3pm) from the User Contributed Perl Documentation, running on perl v5.32.0, dated 2020-10-26 β no cap, that's the source and the date right there, slay π
π¦ where this page comes from
- debian bookworm: libcatalyst-plugin-customerrormessage-perl 0.6-2.2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcatalyst-plugin-customerrormessage-perl 0.6-2.2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libcatalyst-plugin-customerrormessage-perl 0.6-2.2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcatalyst-plugin-customerrormessage-perl 0.6-2.2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcatalyst-plugin-customerrormessage-perl 0.6-2.2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms