Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convenience functions break stacktrace #51

Open
asergei opened this issue Feb 19, 2014 · 1 comment
Open

Convenience functions break stacktrace #51

asergei opened this issue Feb 19, 2014 · 1 comment

Comments

@asergei
Copy link

asergei commented Feb 19, 2014

When an error occurs while using any of convenience functions like quick_select, Dancer is not able to produce a usable stack trace. The error is shown to be originating always from the same line of code in the Database::Handle module. I.e. where that actual call to DBI is made.

Apparently, this has something to do with Carp not being able to track inheritance from DBI correctly.

Update: Upon looking through DBI internals, it seems that DBI implements Carp.pm-like functionality on its own which does not work exactly the same. That's why it is impossible to fix this problem adjusting variables like @CARP_NOT, $CarpLevel in Carp.pm. When an error occurs during SQL statement execution, DBI looks down the calling chain and finds the first module outside of DBI or DBD namespace and reports this module in its error message. Even if this module is a subclass of DBI.
So, the only solution would be to catch and rethrow the error.

@bigpresh
Copy link
Owner

Hmm - yeah, catching the error would probably work. I'll look in to this. It might also be worth suggesting to TIMB that perhaps excluding modules which inherit from DBI would be worth including?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants