- Issue created by @Wim Leers
- π§πͺBelgium Wim Leers Ghent π§πͺπͺπΊ
If such errors are always JSON responses, then we can update the work @balintbrews introduced in π Improve client side error handling Fixed to surface a friendlier error than this:
- π§πͺBelgium Wim Leers Ghent π§πͺπͺπΊ
Aha, for #2 we already have β¨ [PP-1] Add the ability to surface more helpful error details for display in the UI Postponed ! π
But without a structured error response from the server for the client to consume, fixing #2 is impossible.
IOW: this is a blocker for β¨ [PP-1] Add the ability to surface more helpful error details for display in the UI Postponed .
- Assigned to TravisCarden
- πΊπΈUnited States effulgentsia
Wim Leers β credited effulgentsia β .
- πΊπΈUnited States TravisCarden
Wim Leers β credited traviscarden β .
- π§πͺBelgium Wim Leers Ghent π§πͺπͺπΊ
Transfering relevant info + credit from β¨ [PP-1] Add the ability to surface more helpful error details for display in the UI Postponed :
Any path that can result in an exception needs to return well-formed JSON that the UI can interpret as an error message. On the backend, that probably just means creating a new exception class (if one doesn't already exist). On the front-end, it may mean no more than you telling me the JSON format you need for error popups.
One thought I had on what's proposed is that debugging info in case of error responses from the API should be logged on the server side. E.g. a PHP stack trace surfaced in the browser is a security vulnerability.
That's a good point. We already have Drupal logging in place. Now that you point it out, I'm not sure what debugging info would be both safe and helpful in the browser console. Let's start with just the UI error message. Can you tell me how I need to format my JSON error message to be displayed nicely in the UI?
β @traviscarden, #3470321-4: [PP-1] Add the ability to surface more helpful error details for display in the UI β
By the way, there's some prior art in core's jsonapi module for returning a stack trace in the json response if the site is configured to display verbose errors and the user has access to site reports.
So long as we do those two checks, it's safe. But, the question is whether in XB's case if seeing the stack trace in the browser would be helpful or not.
β @effulgentsia, #3470321-5: [PP-1] Add the ability to surface more helpful error details for display in the UI β .