Bug 25504: Improve REST API spec loading errors
authorEre Maijala <ere.maijala@helsinki.fi>
Thu, 18 Jun 2020 13:43:42 +0000 (16:43 +0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 31 Aug 2020 14:10:25 +0000 (16:10 +0200)
commitd01f5f6e8f1e643ada9801bceab6250e2f3a6aab
treeff39ffda4001bda0173e98c2e04cbcb3d320b65d
parent5a87514b2e44d64807422b29f719b29b0c9d1ba4
Bug 25504: Improve REST API spec loading errors

Test plan:
1. Introduce a typo in swagger.json or another spec json file.
2. Restart plack if used or try to access the REST APIs
3. Without the patch, verify that  an incomplete error message and potentially lots of stack trace are logged.
4. With the patch, verify that much more meaningful error messages are logged and stack trace is omitted.
5. Fix the problem introduced in step 1 and verify that no messages are logged, or only warning about bundle is logged with Debian Stretch.
6. Repeat with a REST API plugin.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/REST/Plugin/PluginRoutes.pm
Koha/REST/V1.pm