[Koha-bugs] [Bug 29322] Date validation can be sketchy on the API

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Nov 18 11:28:47 CET 2021


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

--- Comment #3 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
(In reply to Jonathan Druart from comment #1)
> The current situation on master is:
> 
> PUT http://kohadev-intra.mydnsname.org:8081/api/v1/holds/1
>     {
>         "pickup_library_id": "FPL",
>         "priority": 1,
>         "suspended_until": "2021-10-27 23:59"
>     }
> 
> => 
>   "message": "Does not match date-time format.",
>   "path": "/body/suspended_until"
> 
> PUT http://kohadev-intra.mydnsname.org:8081/api/v1/holds/1
>     {
>         "pickup_library_id": "FPL",
>         "priority": 1,
>         "suspended_until": "2021-10-27 23:59:00"
>     }
> 
> =>     "error": "Something went wrong, check Koha logs for details."
> 
> With, in logs:
> [2021/11/18 10:10:47] [ERROR] PUT /api/v1/holds/1: unhandled exception
> (Mojo::Exception)<<The given date (2021-10-27 23:59:00) does not match the
> date format (rfc3339) at /kohadevbox/koha/Koha/DateUtils.pm line 193.>>
> Koha::REST::Plugin::Exceptions::__ANON__
> /kohadevbox/koha/Koha/REST/Plugin/Exceptions.pm (73)

Any 'Something went wrong' message means an uncaught exception. Once detected,
we should catch it correctly and return the right message.

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


More information about the Koha-bugs mailing list