Use Perl Carp to provide backtraces in case of perl crashes

Registered by Philip Stoev

The Perl Carp module (included by default in the distro) provides a Java-like backtrace in case of errors. There should be a way to activate those backtraces for stuff like null pointer dereferences, causing the RQG to look more like Java and prevent situations where processes exit without any visible error message.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Medium
Drafter:
None
Direction:
Approved
Assignee:
Random Query Generator Team
Definition:
Discussion
Series goal:
Accepted for 2.0
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

** Moving from warn/die to carp/croak should be done gradually by all developers.

f we use carp for warnings and croak for fatal errors (die) we will be able add stack trace with perl -MCarp=verbose (or setting programmatically e.g. when --debug etc: $Carp::Verbose=1)

Also, I think croak is a good thing instead of returning a status, since it may be caught by writing
eval {
    Code with croak/die somewhere
}
if ($@) {
   error handling here
} else {
  normal handling here
}

Not quite Java exception handling, but better than massive handling av status variables in the code,

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.