[Koha-bugs] [Bug 32490] New: When there's a broken spec, Mojolicious fails to capture the error properly

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Dec 19 13:30:59 CET 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32490

            Bug ID: 32490
           Summary: When there's a broken spec, Mojolicious fails to
                    capture the error properly
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: REST API
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: martin.renvoize at ptfs-europe.com
                CC: tomascohen at gmail.com

At some point we broke mojolious's built in error processing code.

Instead of a useful stack track we now get a bunch of internal Mojo error code
instead and nothing useful to point at the actual underlying problem.

>>
The application raised the following error:

  Can't use an undefined value as an ARRAY reference at template
mojo/debug.html.ep line 288.
Context:
  283:               </div>
  284:               <div class="tap tap-border-top">tap for more</div>
  285:             </div>
  286:           </div>
  287:           <div class="row">
  288:             % if (@{app->log->history}) {
  289:                 % my $log = join '', map { scalar
app->log->format->(@$_) } @{app->log->history};
  290:                 <pre class="mojo-terminal"><code class="nohighlight"><%=
$log %></code></pre>
  291:             % }
  292:             % else {
  293:               <div class="alert alert-warning wide" role="alert">
Traceback (most recent call first):
  File "template mojo/debug.html.ep", line 288, in
"Mojo::Template::Sandbox::6bff7bf20514502e6c04c41933771297"

. . . internal mojo stuff

  File "/usr/bin/starman", line 38, in "main"

and the StackTrace middleware couldn't catch its stack trace, possibly because
your application overrides $SIG{__DIE__} by itself, preventing the middleware
from working correctly. Remove the offending code or module that does it: known
examples are CGI::Carp and Carp::Always.

For example

I traced this back a little in the server logs where it points to Koha::Logger
not implimenting the 'history' method.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list