Plack-Middleware-BetterStackTrace

 view release on metacpan or  search on metacpan

lib/Plack/Middleware/BetterStackTrace.pm  view on Meta::CPAN

    TODO: Live Shell (REPL) is not implemented yet.
</div-->

<div class="variable_info"></div>

[% IF frame.lexicals %]
<div class="sub">
    <h3>Lexicals</h3>
    <div class='inset variables'>
        <table class="var_table">
            [% FOREACH key IN frame.lexicals.keys() %]
                <tr><td class="name">[% key %]</td><td><pre>[% frame.lexicals.$key | dump %]</pre></td></tr>
            [% end %]
        </table>
    </div>
</div>
[% END %]

[% IF args %]
<div class="sub">
    <h3>Args</h3>
    <div class='inset variables'>
        <table class="var_table">
            [% FOREACH arg IN args %]
                <tr><td class="name">$_[[% loop.index %]]</td><td><pre>[% arg | dump %]</pre></td></tr>
            [% end %]
        </table>
    </div>
</div>
[% END %]
EOTMPL

1;
__END__

=encoding utf-8

=head1 NAME

Plack::Middleware::BetterStackTrace - Displays better stack trace when your app dies

=head1 SYNOPSIS

  enable 'BetterStackTrace',
      application_caller_subroutine => 'Amon2::Web::handle_request';

=head1 DESCRIPTION

This middleware catches exceptions (run-time errors) happening in your
application and displays nice stack trace screen. The stack trace is
also stored in the environment as a plaintext and HTML under the key
C<plack.stacktrace.text> and C<plack.stacktrace.html> respectively, so
that middleware futher up the stack can reference it.

You're recommended to use this middleware during the development and
use L<Plack::Middleware::HTTPExceptions> in the deployment mode as a
replacement, so that all the exceptions thrown from your application
still get caught and rendered as a 500 error response, rather than
crashing the web server.

Catching errors in streaming response is not supported.

This module is based on L<Plack::Middleware::StackTrace> and Better Errors for Ruby L<https://github.com/charliesome/better_errors>.

=head1 LICENSE

Perl

Copyright (C) Tasuku SUENAGA a.k.a. gunyarakun.

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

HTML/CSS/JavaScript

Copyright (C) 2012 Charlie Somerville

MIT License

=head1 AUTHOR

Tasuku SUENAGA a.k.a. gunyarakun E<lt>tasuku-s-github@titech.acE<gt>

=head1 TODO

- REPL
- JSON response

=head1 SEE ALSO

L<Plack::Middleware::StackTrace> L<Devel::StackTrace::AsHTML> L<Plack::Middleware> L<Plack::Middleware::HTTPExceptions>

=cut



( run in 0.584 second using v1.01-cache-2.11-cpan-39bf76dae61 )