Christopher H. Laco wrote:
I've got a slight problem with the way that AxKit logs exceptions.
If I throw an exception (Error.pm based) within the taglib itself, the exception message gets logged as expected.

However, if a module used in the taglib generated perl code throws an exception, AxKit logs just the ref name of that exception object instead of the whole exception text.

This is tracked down to line 391 in AxKit.pm:

die "Unknown exception, " . (ref($E)?"type: ".ref($E):"message is: $E");


Was there any particular reason for this? If I change that line to:

die "Unknown exception,  message is: $E");

everything is happy in both cases and the exception is logged. What I don't quite understand is why an exception object thrown in the taglib itself is missed by ref($E) while one thrown in the from a module in the autogenerated code gets caught by ref($E).

In a perfect world, I would guess that this should be something smarter, maybe even checking isa($E, Error) and acting with exception objects more intuitively.

Has anyone else seen this behaviour when logging exceptions of bebugging tablig errors? This all came up because I was having trouble troubleshooting a taglib I'm working on because the exception text was not in the logs.

Thanks,
-=Chris

On a somewhat stranger note, it looks like the old version 1.5 was semi-aware of Error::Simple...but it's gone from 1.62...

    elsif ($E->isa('Error::Simple') || $E->isa('Apache::AxKit::Exception')) {
          $r->log->error("[AxKit] [UnCaught] $E");
if ($Error::Debug) {
              $r->log->error("[AxKit] [Backtrace] " . $E->stacktrace);
          }
# return error page if a stylesheet for errors has been provided
          my $error_styles = $AxKit::Cfg->ErrorStyles;
          if (@$error_styles) {
              return process_error($r, $E, $error_styles);
          }
return SERVER_ERROR;
      }


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to