Summary: | Koha::Logger is not suitable for using as Mojo::Log | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | REST API | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | CLOSED FIXED | QA Contact: | Jonathan Druart <jonathan.druart> |
Severity: | normal | ||
Priority: | P5 - low | CC: | 1joynelson, jonathan.druart, joonas.kylmala, kyle, martin.renvoize, nick, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
20.05.00
|
|
Circulation function: | |||
Bug Depends on: | 25032 | ||
Bug Blocks: | |||
Attachments: |
Bug 25493: Make ->unhandled_exception use Koha::Logger
Bug 25493: Make ->unhandled_exception use Koha::Logger Bug 25493: Make ->unhandled_exception use Koha::Logger |
Description
Tomás Cohen Arazi (tcohen)
2020-05-13 20:13:05 UTC
Created attachment 104852 [details] [review] Bug 25493: Make ->unhandled_exception use Koha::Logger To test: 1. Edit the Koha/REST/V1/Cities.pm 'list' method adding die("Nada"); before the render step. 2. Restart plack and try the endpoint => SUCCESS: The message is generic, but you see something is logged in /var/log/koha/kohadev/api-error.log 3. Change die("Nada"); for a real exception like: use Koha::Exceptions; Koha::Exceptions::DuplicateObject->throw("Nada"); 4. Repeat 2. => SUCCESS: The message is generic, but a meaningful text is added to the logs. 5. Point your browser to the /api/v1/hola route from your dev environment => FAIL: Wow, such a weird error 6. Apply this patch 7. Restart plack and repeat 2, 3 and 4 => SUCCESS: No behaviour change 8. Repeat 5 => SUCCESS: The regular Mojolicious 404 weird page 9. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 105016 [details] [review] Bug 25493: Make ->unhandled_exception use Koha::Logger To test: 1. Edit the Koha/REST/V1/Cities.pm 'list' method adding die("Nada"); before the render step. 2. Restart plack and try the endpoint => SUCCESS: The message is generic, but you see something is logged in /var/log/koha/kohadev/api-error.log 3. Change die("Nada"); for a real exception like: use Koha::Exceptions; Koha::Exceptions::DuplicateObject->throw("Nada"); 4. Repeat 2. => SUCCESS: The message is generic, but a meaningful text is added to the logs. 5. Point your browser to the /api/v1/hola route from your dev environment => FAIL: Wow, such a weird error 6. Apply this patch 7. Restart plack and repeat 2, 3 and 4 => SUCCESS: No behaviour change 8. Repeat 5 => SUCCESS: The regular Mojolicious 404 weird page 9. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 105100 [details] [review] Bug 25493: Make ->unhandled_exception use Koha::Logger To test: 1. Edit the Koha/REST/V1/Cities.pm 'list' method adding die("Nada"); before the render step. 2. Restart plack and try the endpoint => SUCCESS: The message is generic, but you see something is logged in /var/log/koha/kohadev/api-error.log 3. Change die("Nada"); for a real exception like: use Koha::Exceptions; Koha::Exceptions::DuplicateObject->throw("Nada"); 4. Repeat 2. => SUCCESS: The message is generic, but a meaningful text is added to the logs. 5. Point your browser to the /api/v1/hola route from your dev environment => FAIL: Wow, such a weird error 6. Apply this patch 7. Restart plack and repeat 2, 3 and 4 => SUCCESS: No behaviour change 8. Repeat 5 => SUCCESS: The regular Mojolicious 404 weird page 9. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> A simple pragmatic approach to resolving the bug before release, thanks guys Passing QA Nice work everyone! Pushed to master for 20.05 missing dependencies-not backported to 19.11.x |