Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DBIx-NinjaORM CPAN distribution.

Report information
The Basics
Id: 83129
Status: resolved
Priority: 0/
Queue: DBIx-NinjaORM

People
Owner: Nobody in particular
Requestors: bvoorhes [...] thinkgeek.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Need to report correct line numbers
Date: Mon, 04 Feb 2013 17:29:31 -0500
To: bug-DBIx-NinjaORM [...] rt.cpan.org
From: Brian Voorhes <bvoorhes [...] thinkgeek.com>
Currently, when the code dies for one reason or another please drop a stack trace along with the error. An example change could be: From: # If the field exists in the list of filters, it needs to be # defined. Being undefined probably indicates a problem in the calling code. croak "Called new() with '$field' declared but not defined" if ! defined( $filters->{ $field } ); To: # If the field exists in the list of filters, it needs to be # defined. Being undefined probably indicates a problem in the calling code. if ( ! defined( $filters->{ $field } ) ) { $log->error("Called new() with '$field' declared but not defined"); croak "Called new() with '$field' declared but not defined" }
On Mon Feb 04 17:29:44 2013, bvoorhes@thinkgeek.com wrote: Show quoted text
> Currently, when the code dies for one reason or another please drop a > stack trace along with the error. An example change could be: > > From: > > # If the field exists in the list of filters, it needs to be > # defined. Being undefined probably indicates a problem in the > calling code. > croak "Called new() with '$field' declared but not defined" > if ! defined( $filters->{ $field } ); > > To: > > # If the field exists in the list of filters, it needs to be > # defined. Being undefined probably indicates a problem in the > calling code. > if ( ! defined( $filters->{ $field } ) ) > { > $log->error("Called new() with '$field' declared but not > defined"); > croak "Called new() with '$field' declared but not defined" > }
I considered redefining croak() to something like this: sub croak { my ( $message ) = @_; $log->fatal( $message ); Carp::croak $message; } However, some of the catch {} blocks already have a $log->fatalf() call before the croak(), so I think I'm going to have to review all the croak() calls and do what you suggest. It's also a good opportunity to put more information in the fatalf() call than what the croak() message has.
Transfered to GitHub issues: https://github.com/guillaumeaubert/DBIx-NinjaORM/issues/20. Closing accordingly in RT.