Summary: | Exceptions thrown during a call to ->render are not caught and passed to ->unhandled_exception | ||
---|---|---|---|
Product: | Koha | Reporter: | Martin Renvoize (ashimema) <martin.renvoize> |
Component: | REST API | Assignee: | Bugs List <koha-bugs> |
Status: | NEW --- | QA Contact: | |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | julian.maurice, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 27680 | ||
Bug Blocks: | |||
Attachments: |
Bug 27806: (follow-up) Add Koha::Exception for bad queries
Bug 27806: (follow-up) Attempt to catch the exception |
Description
Martin Renvoize (ashimema)
2021-02-26 13:27:50 UTC
Created attachment 117376 [details] [review] Bug 27806: (follow-up) Add Koha::Exception for bad queries This patch adds a PropertyNotFound exception tothe 'as_list' method to catch DBIx::Class excpetions caused by passing bad column names into a query. Created attachment 117377 [details] [review] Bug 27806: (follow-up) Attempt to catch the exception Help: I'm struggling to catch the point at which the exception should be thrown to convert it to a 400 error response in the API. '->search' does not actually trigger the DB hit until we reference some data from it.. so we can't use that.. so I tried '->count', but of course.. that drops 'order_by' which is the failure in this case and so we pass through. |