Skip to content

Commit

Permalink
Add noqa for BaseException
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong committed Apr 18, 2024
1 parent 8303053 commit 7f8d5a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/cloudformation_cli_python_lib/hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def test_entrypoint(
return e.to_progress_event()
except Exception: # pylint: disable=broad-except
LOG.exception("Exception caught")
except BaseException: # pylint: disable=broad-except
except BaseException: # pylint: disable=broad-except # noqa: B036
LOG.critical("Base exception caught (this is usually bad)", exc_info=True)
return ProgressEvent.failed(HandlerErrorCode.InternalFailure, msg)

Expand Down Expand Up @@ -260,7 +260,7 @@ def print_or_log(message: str) -> None:
except Exception as e: # pylint: disable=broad-except
print_or_log(f"Exception caught {e}")
progress = ProgressEvent.failed(HandlerErrorCode.InternalFailure)
except BaseException as e: # pylint: disable=broad-except
except BaseException as e: # pylint: disable=broad-except # noqa: B036
print_or_log(f"Base exception caught (this is usually bad) {e}")
progress = ProgressEvent.failed(HandlerErrorCode.InternalFailure)

Expand Down
4 changes: 2 additions & 2 deletions src/cloudformation_cli_python_lib/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def test_entrypoint(
return e.to_progress_event()
except Exception: # pylint: disable=broad-except
LOG.exception("Exception caught")
except BaseException: # pylint: disable=broad-except
except BaseException: # pylint: disable=broad-except # noqa: B036
LOG.critical("Base exception caught (this is usually bad)", exc_info=True)
return ProgressEvent.failed(HandlerErrorCode.InternalFailure, msg)

Expand Down Expand Up @@ -229,7 +229,7 @@ def print_or_log(message: str) -> None:
except Exception as e: # pylint: disable=broad-except
print_or_log(f"Exception caught {e}")
progress = ProgressEvent.failed(HandlerErrorCode.InternalFailure)
except BaseException as e: # pylint: disable=broad-except
except BaseException as e: # pylint: disable=broad-except # noqa: B036
print_or_log(f"Base exception caught (this is usually bad) {e}")
progress = ProgressEvent.failed(HandlerErrorCode.InternalFailure)

Expand Down

0 comments on commit 7f8d5a2

Please sign in to comment.