Bug 39191

Summary: Add a `format` param to Koha::Exceptions::ArticleRequest::WrongFormat
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: Pushed to main --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: enhancement    
Priority: P5 - low CC: martin.renvoize, 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:
25.05.00
Circulation function:
Bug Depends on: 36081    
Bug Blocks:    
Attachments: Bug 39191: Add `format` parameter to Koha::Exceptions::ArticleRequest::WrongFormat
Bug 39191: Add `format` parameter to Koha::Exceptions::ArticleRequest::WrongFormat

Description Tomás Cohen Arazi (tcohen) 2025-02-24 17:27:16 UTC
It would be handy if the exception carried the 'wrong format passed' which happens to be available in the context the exception is thrown.
Comment 1 Tomás Cohen Arazi (tcohen) 2025-02-24 17:39:37 UTC
Created attachment 178616 [details] [review]
Bug 39191: Add `format` parameter to Koha::Exceptions::ArticleRequest::WrongFormat

This patch just adds a new parameter so any exception consumer or even
the logs contain more information about the context in which the
exception was thrown. This would be useful debugging issues.

No behavior change in Koha.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/ArticleRequest.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 2
=> SUCCESS: Tests pass!
4. Sign off :-D
Comment 2 Martin Renvoize (ashimema) 2025-04-02 14:12:36 UTC
Created attachment 180397 [details] [review]
Bug 39191: Add `format` parameter to Koha::Exceptions::ArticleRequest::WrongFormat

This patch just adds a new parameter so any exception consumer or even
the logs contain more information about the context in which the
exception was thrown. This would be useful debugging issues.

No behavior change in Koha.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/ArticleRequest.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 2
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 3 Martin Renvoize (ashimema) 2025-04-02 14:13:12 UTC
Trivial, clear improvement.. works as expected.

Passing QA
Comment 4 Katrin Fischer 2025-04-23 07:43:01 UTC
Pushed for 25.05!

Well done everyone, thank you!