Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add noqa for BaseException #272

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading