Bug 31138 - DataTables is not raising error to the end user
Summary: DataTables is not raising error to the end user
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Kyle M Hall (khall)
URL:
Keywords:
Depends on:
Blocks: 31269 31343
  Show dependency treegraph
 
Reported: 2022-07-12 08:08 UTC by Jonathan Druart
Modified: 2023-06-08 22:26 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00, 22.05.05, 21.11.12, 21.05.19
Circulation function:


Attachments
Bug 31138: Don't ignore DataTables errors and raise them to the end-user (1.86 KB, patch)
2022-07-12 08:12 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 31138: Don't ignore DataTables errors and raise them to the end-user (1.92 KB, patch)
2022-07-12 09:45 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 31138: Don't ignore DataTables errors and raise them to the end-user (1.98 KB, patch)
2022-07-22 14:32 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2022-07-12 08:08:13 UTC
DataTables is not raising error to the end user, it's only displaying a generic message in the console.
This leads to lot of questions on IRC or the mailing list ("the table is empty").
We can do better and display what went wrong.

We could also imagine add a link to the wiki for the more common problems (won't be implemented here however).
Comment 1 Jonathan Druart 2022-07-12 08:12:07 UTC
Created attachment 137609 [details] [review]
Bug 31138: Don't ignore DataTables errors and raise them to the end-user

DataTables is not raising error to the end user, it's only displaying a generic message in the console.
This leads to lot of questions on IRC or the mailing list ("the table is empty").
We can do better and display what went wrong.

We could also imagine add a link to the wiki for the more common problems (won't be implemented here however).

Test plan:
Revert "Bug 31104: Put each link on a separate header" and search for a
patron using a very long string
You should get an alert with the reponse of the server.
In my case:
"""
Something went wrong when loading the table.
414: Request-URI Too Long
"""

You can also make the REST API returns a 500 (bad specs or simply with a
die statement).
Comment 2 Martin Renvoize (ashimema) 2022-07-12 09:45:36 UTC
Created attachment 137615 [details] [review]
Bug 31138: Don't ignore DataTables errors and raise them to the end-user

DataTables is not raising error to the end user, it's only displaying a generic message in the console.
This leads to lot of questions on IRC or the mailing list ("the table is empty").
We can do better and display what went wrong.

We could also imagine add a link to the wiki for the more common problems (won't be implemented here however).

Test plan:
Revert "Bug 31104: Put each link on a separate header" and search for a
patron using a very long string
You should get an alert with the reponse of the server.
In my case:
"""
Something went wrong when loading the table.
414: Request-URI Too Long
"""

You can also make the REST API returns a 500 (bad specs or simply with a
die statement).

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize (ashimema) 2022-07-12 09:47:28 UTC
Works as designed.. signing off.

We could go a little further and grab our API error messages from 'responseJSON'.. but I'm not sure if would yield any better results in terms of people coming and asking for help.. we're still likely to need to ask for more details to really investigate any problems and as such direct them at the console and networking log to get those details anyway.
Comment 4 Kyle M Hall (khall) 2022-07-22 14:32:04 UTC
Created attachment 138030 [details] [review]
Bug 31138: Don't ignore DataTables errors and raise them to the end-user

DataTables is not raising error to the end user, it's only displaying a generic message in the console.
This leads to lot of questions on IRC or the mailing list ("the table is empty").
We can do better and display what went wrong.

We could also imagine add a link to the wiki for the more common problems (won't be implemented here however).

Test plan:
Revert "Bug 31104: Put each link on a separate header" and search for a
patron using a very long string
You should get an alert with the reponse of the server.
In my case:
"""
Something went wrong when loading the table.
414: Request-URI Too Long
"""

You can also make the REST API returns a 500 (bad specs or simply with a
die statement).

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Tomás Cohen Arazi (tcohen) 2022-07-22 17:52:41 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 6 Lucas Gass (lukeg) 2022-09-02 15:12:50 UTC
Backported to 22.05.x for 22.05.05
Comment 7 Arthur Suzuki 2022-09-14 12:59:13 UTC
Thanks!

Pushed to 21.11 for 21.11.12
Comment 8 Victor Grousset/tuxayo 2022-09-19 21:45:40 UTC
Backported: Pushed to 21.05.x branch for 21.05.19