[Bug 34448] New: ERM should be able to display error messages coming from the API
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 Bug ID: 34448 Summary: ERM should be able to display error messages coming from the API Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: ERM Assignee: jonathan.druart+koha@gmail.com Reporter: pedro.amorim@ptfs-europe.com CC: jonathan.druart+koha@gmail.com, jonathan.field@ptfs-europe.com, martin.renvoize@ptfs-europe.com, matt.blenkinsop@ptfs-europe.com, pedro.amorim@ptfs-europe.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 --- Comment #1 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 154097 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154097&action=edit Bug 34448: Update the way we handle response in http-client.js Test plan: Before patch: - Visit a non-existent ID i.e. /cgi-bin/koha/erm/agreements/999 - Visit a char ID i.e. /cgi-bin/koha/erm/agreements/abc Apply patch: Repeat above steps. Run cypress tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 --- Comment #2 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 154098 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154098&action=edit Bug 34448: Update cypress tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154098|0 |1 is obsolete| | --- Comment #3 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 154099 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154099&action=edit Bug 34448: Update cypress tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 --- Comment #4 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- I would keep the console.log with the whole 'response' object. Looking at js/datatables.js, https://git.koha-community.org/Koha-community/Koha/src/branch/master/koha-tm... And wondering if we should not split on several lines instead of separating with a space. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154099|0 |1 is obsolete| | --- Comment #5 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 154123 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154123&action=edit Bug 34448: Update cypress tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154097|0 |1 is obsolete| | --- Comment #6 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 154124 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154124&action=edit Bug 34448: Update the way we handle response in http-client.js Test plan: Before patch: - Visit a non-existent ID i.e. /cgi-bin/koha/erm/agreements/999 - Visit a char ID i.e. /cgi-bin/koha/erm/agreements/abc Apply patch: Repeat above steps. Run cypress tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 --- Comment #7 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Jonathan Druart from comment #4)
I would keep the console.log with the whole 'response' object.
Looking at js/datatables.js,
https://git.koha-community.org/Koha-community/Koha/src/branch/master/koha- tmpl/intranet-tmpl/prog/js/datatables.js#L493
And wondering if we should not split on several lines instead of separating with a space.
Thank you very much Jonathan, I've squashed that into the patch! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Before: Something went wrong: Error: Error: Internal Server Error (500) After: Something went wrong: Error: Error: Something went wrong, check Koha logs for details. Before: Something went wrong: Error: Not Found (404) After: Something went wrong: Error: Agreement not found Before: Something went wrong: Error: Bad Request (400) After: Something went wrong: Error: Expected integer - got string. Note for myself: """The ok read-only property of the Response interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not.""" Only wondering if we should not keep the HTTP status code. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154123|0 |1 is obsolete| | Attachment #154124|0 |1 is obsolete| | --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 154259 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154259&action=edit Bug 34448: Update cypress tests Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 154260 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154260&action=edit Bug 34448: Update the way we handle response in http-client.js Test plan: Before patch: - Visit a non-existent ID i.e. /cgi-bin/koha/erm/agreements/999 - Visit a char ID i.e. /cgi-bin/koha/erm/agreements/abc Apply patch: Repeat above steps. Run cypress tests Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|jonathan.druart+koha@gmail. |pedro.amorim@ptfs-europe.co |com |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34587 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34587 [Bug 34587] Add a Usage Statistics module to ERM -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- Can we backport to 23.05.x ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 --- Comment #13 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Fridolin Somers from comment #12)
Can we backport to 23.05.x ?
I believe so, if it applies and the test plan checks out? It's technically an enhancement, though. Up to you really! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|23.11.00 |23.11.00,23.05.04 released in| | --- Comment #14 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.05.x for 23.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|23.11.00,23.05.04 |23.11.00,23.05.04,22.11.10 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 --- Comment #15 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Nice work everyone! Pushed to oldstable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 --- Comment #16 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- 386 // Submit the form, get 500 387 cy.intercept("POST", "/api/v1/erm/agreements", { 388 statusCode: 500, 389 error: "Something went wrong", 390 }); 391 cy.get("#agreements_add").contains("Submit").click(); 392 cy.get("main div[class='dialog alert']").contains( 393 "Something went wrong: SyntaxError: Unexpected end of JSON input" 394 ); This is totally wrong. We are now showing a JS error instead of the expected 500: internal server error! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34448 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35199 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35199 [Bug 35199] Fix error handling in http-client.js -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org