Problem/Motivation
In #3502465: Reduce the amount of information relayed on error by the DrupalOrgJsonApi plugin to the front-end, we changed the message that we show to users if there is an error. Part of that message is: See the error log for details.
It'd be great if we could detect if the dblog module is enable and offer a link in that message.
Steps to reproduce
You can do the changes seen in this commit https://git.drupalcode.org/project/project_browser/-/merge_requests/685/... to force the error (just don't commit them).
Proposed resolution
Detect if dblog is enabled, and in that case have the words error log point at it, otherwise leave the message as is.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3502603-6-with-dblog.png | 31.7 KB | phenaproxima |
| #6 | 3502603-6-without-dblog.png | 30.35 KB | phenaproxima |
Issue fork project_browser-3502603
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
sayan_k_dutta commentedWorking on it.
Comment #4
sayan_k_dutta commentedMade the required changes.
Checked if the dblog module is enabled or not. If enabled, the is a link to the dblog overview page which is embeded in the "error log" string of the error message. If the dblog module is not enabled, the error message is shown as it is.
Please review MR !704.
Comment #5
sayan_k_dutta commentedMade the changes requested. Please review.
Comment #6
phenaproximaGave this a quick manual testing using the error-forcing method described in the issue summary.
Without dblog enabled, I see this when fetching modules:
And with it:
That's pretty straightforwardly what I'd expect. The "error log" link takes me to the error log as promised, and the first thing in it is the HTTP error that came back from d.o. Definitely useful for forensic purposes.
I'd say this is pretty clearly good to go.
Comment #7
phenaproximaComment #10
chrisfromredfinnice little ux improvement here!