Skip to content

Log something when catching exceptions outside of the handler #60

Description

@benbridts

(I know this is still beta, I'm logging everything I run into during testing)

Currently uncaught exceptions are handled by the library. This is great, because it means I can't forget to write a try/except around the whole method.

However when this happens nothing is logged about the underlying exception. So it's impossible to see what went wrong without deploying a new version that catches all exceptions and logs them inside the handler.

It would be nice if we could have a log of unexpected exceptions without boilerplate code in every handler

Activity

  1. self-assigned this
    on Nov 25, 2019
  2. tobywf commented on Nov 25, 2019

    @tobywf
    Contributor

    looks like the issue is the logging that's there isn't set up for cross-account log delivery. may have overlooked when that was set up in #36 .

  3. tobywf commented on Nov 28, 2019

    @tobywf
    Contributor

    With PR #64 , I actually do get uncaught errors delivered:

    Exception caught
    Traceback (most recent call last): File "/var/task/cloudformation_cli_python_lib/resource.py", line 216, in __call__ progress = self._invoke_handler(caller_sess, request, action, callback) File "/var/task/cloudformation_cli_python_lib/resource.py", line 123, in _invoke_handler progress = handler(session, request, callback_context) File "/var/task/test_me_python/handl
    Exception caught
    Traceback (most recent call last):
      File "/var/task/cloudformation_cli_python_lib/resource.py", line 216, in __call__
        progress = self._invoke_handler(caller_sess, request, action, callback)
      File "/var/task/cloudformation_cli_python_lib/resource.py", line 123, in _invoke_handler
        progress = handler(session, request, callback_context)
      File "/var/task/test_me_python/handlers.py", line 29, in create_handler
        raise ValueError("foo")
    ValueError: foo
    

    So I think we can close this soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions