Bug 32777

Summary: Unhandled exception not displaying stack trace
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: REST APIAssignee: Bugs List <koha-bugs>
Status: In Discussion --- QA Contact:
Severity: enhancement    
Priority: P5 - low CC: m.de.rooy, martin.renvoize, nick, tomascohen
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 25032    
Bug Blocks:    
Attachments: Bug 32777: Display stack trace for REST API unhandled exception

Description Jonathan Druart 2023-02-01 11:18:30 UTC
It's painful to debug, we should display the stack trace to track down the root of the problem.
Comment 1 Jonathan Druart 2023-02-01 11:20:46 UTC
Created attachment 145929 [details] [review]
Bug 32777: Display stack trace for REST API unhandled exception
Comment 2 Jonathan Druart 2023-02-01 11:21:49 UTC
Do we need that in production as well? Do we actually have stack traces in production for other 500? If not, why? How do people debug crashes if they are not displayed?
Comment 3 Marcel de Rooy 2023-02-01 12:35:57 UTC
I am all for those stack traces. Note that the stack trace in plack-error.log often contains only a few useful lines. All the internal Plack stuff is just waste of space..
Devel::Stacktrace allows you to filter?
Comment 4 Marcel de Rooy 2023-02-17 10:58:31 UTC
Can we proceed here?
Comment 5 Jonathan Druart 2023-02-17 11:12:32 UTC
(In reply to Marcel de Rooy from comment #4)
> Can we proceed here?

Not sure how. We are going to display a stack trace in production, and I think we don't for other exceptions (whereas we should IMO).
So maybe we should add a 'if $dev_install' condition to display the stack trace?
Comment 6 Marcel de Rooy 2023-02-20 08:10:25 UTC
(In reply to Jonathan Druart from comment #5)
> So maybe we should add a 'if $dev_install' condition to display the stack
> trace?

Configurable number of frames from the top? Zero means no trace?
Not sure if this is a parameter from Devel module though.