You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/06/03 00:37:32 UTC
[GitHub] [superset] betodealmeida commented on a diff in pull request #20252: chore: use exc_info to pass errors to log warnings
betodealmeida commented on code in PR #20252:
URL: https://github.com/apache/superset/pull/20252#discussion_r888516804
##########
superset/views/base.py:
##########
@@ -446,7 +446,7 @@ def show_http_exception(ex: HTTPException) -> FlaskResponse:
# or SupersetErrorsException, with a specific status code and error type
@superset_app.errorhandler(CommandException)
def show_command_errors(ex: CommandException) -> FlaskResponse:
- logger.warning(ex)
+ logger.warning("Command Exception", exc_info=True)
Review Comment:
Same here:
```suggestion
logger.warning("CommandException", exc_info=True)
```
##########
superset/views/base.py:
##########
@@ -420,7 +420,7 @@ def refresh_csrf_token(ex: CSRFError) -> FlaskResponse:
@superset_app.errorhandler(HTTPException)
def show_http_exception(ex: HTTPException) -> FlaskResponse:
- logger.warning(ex)
+ logger.warning("HTTP Exception", exc_info=True)
Review Comment:
Nit, for consistency I'd leave this as `HTTPException`, similar to how you did `SupersetErrorsException` — might be easier to grep.
```suggestion
logger.warning("HTTPException", exc_info=True)
```
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org