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

--- Comment #8 from Tomás Cohen Arazi <[email protected]> ---
(In reply to Martin Renvoize from comment #6)
> Hoping to get an answer from Tomas on this one regarding Jonathan's
> question.. we would like to know if the API should really be returning the
> actual exception error in the 500 response.

The usual pattern is:

        unless ( blessed $_ && $_->can('rethrow') ) {
            return $c->render(
                status  => 500,
                openapi => {
                    error =>
                      "Something went wrong, check Koha logs for details."
                }
            );
        }
        return $c->render(
            status  => 500,
            openapi => { error => "$_" }
        );

So if it is not showing the exception info it is because it is not an
exception. In both cases I'd feel comfortable with a change to send the
exception to the logs, unless debugging is set (i.e. no need to give the
consumer details about the internal problems in Koha). So I vote for all
unhandled exceptions to return a generic internal server error and warn the
exception info.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to