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

Already on GitHub? Sign in to your account

Convenience functions break stacktrace #51

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

Comments

Projects
None yet
2 participants

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.

Owner

bigpresh commented Oct 29, 2014

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