Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tarao/perl5-plack-middleware-stacktrace-rethrowfriendly
https://github.com/tarao/perl5-plack-middleware-stacktrace-rethrowfriendly
perl plack
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/tarao/perl5-plack-middleware-stacktrace-rethrowfriendly
- Owner: tarao
- License: other
- Created: 2015-03-12T08:04:42.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-17T02:32:16.000Z (almost 10 years ago)
- Last Synced: 2024-10-16T05:43:50.495Z (2 months ago)
- Topics: perl, plack
- Language: Perl
- Size: 188 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/tarao/perl5-Plack-Middleware-StackTrace-RethrowFriendly.svg?branch=master)](https://travis-ci.org/tarao/perl5-Plack-Middleware-StackTrace-RethrowFriendly)
# NAMEPlack::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](https://metacpan.org/pod/Plack::Middleware::StackTrace) except
that additional information for rethrown errors are available for HTML
stack trace.If you catch (`eval` or `try`-`catch` for example) an error and
rethrow (`die` or `croak` 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](https://metacpan.org/pod/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 in `another`.`Plack::Middleware::StackTrace::RethrowFriendly` displays stack
traces of both (1) and (2) in each page and (1) is selected by
default.# SEE ALSO
[Plack::Middleware::StackTrace](https://metacpan.org/pod/Plack::Middleware::StackTrace)
# 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
INA Lintaro