-
-
17 Mar 2015 02:33:04 UTC
- Distribution: Plack-Middleware-StackTrace-RethrowFriendly
- Module version: 0.03
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (546 / 1 / 0)
- Kwalitee
Bus factor: 0- 93.44% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (12.4KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors-
TOYAMA Nao
NAME
Plack::Middleware::StackTrace::RethrowFriendly - Display the original stack trace for rethrown errors
SYNOPSIS
use Plack::Builder; builder { enable "StackTrace::RethrowFriendly"; $app; };
DESCRIPTION
This middleware is the same as Plack::Middleware::StackTrace except that additional information for rethrown errors are available for HTML stack trace.
If you catch (
eval
ortry
-catch
for example) an error and rethrow (die
orcroak
for example) it, all the errors including rethrown ones are visible through the throwing point selector at the top of the HTML.For example, consider the following code.
sub fail { die 'foo'; } sub another { fail(); } builder { enable 'StackTrace'; sub { eval { fail() }; # (1) another(); # (2) return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'OK' ] ]; }; };
Plack::Middleware::StackTrace blames (1) since it is the first place where
'foo'
is raised. This behavior may be misleading if the real culprit was something done inanother
.Plack::Middleware::StackTrace::RethrowFriendly
displays stack traces of both (1) and (2) in each page and (1) is selected by default.SEE ALSO
LICENSE
Copyright (C) TOYAMA Nao and INA Lintaro
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
TOYAMA Nao <nanto@moon.email.ne.jp>
INA Lintaro <tarao.gnn@gmail.com>
Module Install Instructions
To install Plack::Middleware::StackTrace::RethrowFriendly, copy and paste the appropriate command in to your terminal.
cpanm Plack::Middleware::StackTrace::RethrowFriendly
perl -MCPAN -e shell install Plack::Middleware::StackTrace::RethrowFriendly
For more information on module installation, please visit the detailed CPAN module installation guide.