etr2460 opened a new issue #9194: [SIP-40] Proposal for Custom Error Messages
URL: https://github.com/apache/incubator-superset/issues/9194
 
 
   ## [SIP-40] Proposal for Custom Error Messages
   
   ### Motivation
   
   The current user experience for error cases in Superset does not provide 
actionable feedback to users. Error messages often are displayed straight from 
the backend and are fairly inscrutable. Additionally, there’s no way to 
customize or add other functionality to these messages on a deployment by 
deployment basis. A key part of the user experience is providing friendly, 
actionable messaging when something goes wrong.
   
   ### Proposed Change
   
   We propose a new, unified pattern for error handling in API endpoints across 
all of Superset. This will consist of the following work:
   1. Unify the backend around a standard error payload for all API errors 
returned from Superset of the format:
   ```
   {
     message: string,
     error_type: Enum,
     level: ‘info’ | ‘warning’ | ‘error’,
     extra: Dict[string, Any],
   }
   ```
   2. Create an Enum on both the server and client side for uniquely 
identifying error types. The specific type of an error is included in the 
standard error payload (e.g. ACCESS_DENIED, DB_ENGINE_SYNTAX_ERROR, etc.)
   3. Refactor Superset’s frontend to go through a single `SupersetAlert` 
component for handling all error messages. This component will import a 
renderer file that defaults to some generic error customization messages (ex. 
Adding Request Access links).
   4. Allow a Superset admin to specify an override renderer file that gets 
used instead of the default renderer. This override renderer is injected with a 
Webpack Plugin.
   
   ### New or Changed Public Interfaces
   
   - All APIs within Superset will return the above error payload on 4xx and 
5xx status code responses.
   - Client side options will be made public for injecting your own error 
rendering file
   
   ### New dependencies
   
   There may be a new Webpack Plugin required for injecting the custom renderer.
   
   ### Migration Plan and Compatibility
   
   No migrations should be necessary, but the new API may not be backwards 
compatible. Any changes to the current API will be notated in UPDATING.md and 
should take place prior to v1.0.0.
   
   ### Rejected Alternatives
   
   Server side rendering of errors was rejected as we’re trying to remove the 
existing templates and move all rendering to the client side
   
   cc: @kristw @rusackas @nytai @graceguo-supercat @ktmud

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to