- SEE ALSO
- COPYRIGHT AND LICENSE
Devel::StackTrace::Extract - Extract a stack trace from an exception object
It's popular to store stack traces in objects that are thrown as exceptions, but, this being Perl, there's more than one way to do it. This module provides a simple interface to attempt to extract the stack trace from various well known exception classes that are on the CPAN.
Exported on demand or can be used fully qualified
Returns a Devel::StackTrace stack trace object extracted from the exception object or returns undef if no stack trace can be extracted with the current heuristics.
The current rules that this uses to determine how to get a stack trace are, in order, as follows (these are subject to change without notice):
- If it has a method called
- If it is a Mojo::Exception, and has a method called
If we have a modern Mojo::Exception object with a
framesmethod, and it has its frames populated (i.e. someone used the
tracemethod, or called
throw) then we'll synthesize a Devel::StackTrace instance from that.
- If it has a
tracemethod call that
The heuristics in this make no attempt to check whatever is returned by the exception classes are valid Devel::StackTrace objects
Mark Fowler <firstname.lastname@example.org>
Dave Rolsky <email@example.com>
Mark Fowler <firstname.lastname@example.org>
Olaf Alders <email@example.com>
This software is copyright (c) 2016 by MaxMind, Inc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.