chore: stop logging "SyntaxError" as exceptions (#21787)

This commit is contained in:
Hugh A. Miles II 2022-10-13 11:58:02 -04:00 committed by GitHub
parent 49b48eeca4
commit e6c44e02cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -313,7 +313,6 @@ def execute_sql_statement( # pylint: disable=too-many-arguments,too-many-statem
if query.status == QueryStatus.STOPPED:
raise SqlLabQueryStoppedException() from ex
logger.error("Query %d: %s", query.id, type(ex), exc_info=True)
logger.debug("Query %d: %s", query.id, ex)
raise SqlLabException(db_engine_spec.extract_error_message(ex)) from ex

View File

@ -132,6 +132,8 @@ class ExecuteSqlCommand(BaseCommand):
) from ex
raise ex
except Exception as ex:
query_id = query.id if query else None
logger.exception("Query %d: %s", query_id, type(ex))
raise SqlLabException(self._execution_context, exception=ex) from ex
def _try_get_existing_query(self) -> Optional[Query]: