[Koha-bugs] [Bug 25493] Koha::Logger is not suitable for using as Mojo::Log

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue May 19 16:13:29 CEST 2020


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

Martin Renvoize <martin.renvoize at ptfs-europe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #105016|0                           |1
        is obsolete|                            |

--- Comment #3 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 105100
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105100&action=edit
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 at theke.io>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

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


More information about the Koha-bugs mailing list