Bug 33816

Summary: Holds API errors not easily machine-readable
Product: Koha Reporter: David Cook <dcook>
Component: REST APIAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P5 - low CC: tomascohen
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description David Cook 2023-05-24 00:09:55 UTC
At the moment, if you place a hold via the Holds API and there are too many holds for the record, you get the following response:

{"error":"Hold cannot be placed. Reason: tooManyHoldsForThisRecord"}

That's a message that is meant for a human developer. It's not showable to a human audience, and it's not easily parsed by a machine. 

It would be good to have a human readable message for troubleshooting, but the core error code should just be "tooManyHoldsForThisRecord", as a machine can take that string and work with it as a code.