betodealmeida commented on PR #30067: URL: https://github.com/apache/superset/pull/30067#issuecomment-2327151403
@betodealmeida while I recognize it's normally an anti-pattern, no rule is 100% correct ([an example](https://blog.jooq.org/rare-uses-of-a-controlflowexception/) where it can be useful). For OAuth2 we're basically building a fancy 403 response that has information about how to proceed. We need to let the exception bubble up to the Flask error handler so that we can build a proper SIP-40 compliant error payload, which is what triggers OAuth2 in the frontend side. The benefit of this approach is that we can trigger OAuth2 without having to modify every API that might need it — instead all we need to do is attach a `ErrorMessageWithStackTrace` to the DOM. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
