etr2460 commented on issue #9194: [SIP-40] Proposal for Custom Error Messages
URL: 
https://github.com/apache/incubator-superset/issues/9194#issuecomment-590612592
 
 
   @suddjian:
   
   Dynamic error messages should be supported on the frontend with the 
translation package: 
https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-translation#api
   
   My vision is to have a default renderer that simply renders the message 
passed from the backend, something we can guarantee exists every time. That's 
why i'd prefer not to label it as `debug` since if it's not handled in any 
other way, we'd display this field. However, if you wanted to render a more 
specific component, you'd rely on the `error_type` passed and the content in 
`extra` to render it. I would envision that applying to form validation errors 
too. An InputValidationError would be a subtype of Error where error_type = 
`INPUT_VALIDATION_ERROR` and `extra` is defined as an object that must contain 
a `field_name` and a `message_params` attribute. This InputValidationError 
could also be defined on the backend so the extra field is guaranteed to match 
what's expected. Then you'd be able to get type safety on the front end as 
well. Thoughts?

----------------------------------------------------------------
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