Zappa icon indicating copy to clipboard operation
Zappa copied to clipboard

[Migrated] Wrap Call to Application for Better Error Reporting

Open jneves opened this issue 4 years ago • 1 comments

Originally from: https://github.com/Miserlou/Zappa/issues/963 by mcrowson

Context

When a users application fails to load the only log that is in CW is usually just 'NoneType' object is not callable. This is not terribly helpful for debugging purposes.

Expected Behavior

When the user's application fails to load let them know.

Actual Behavior

They get a cryptic message.

Possible Fix

After we get back the response from the middleware: https://github.com/Miserlou/Zappa/blob/master/zappa/middleware.py#L66

I think we could check the response to see if it exists (is it a None type). Then we can log something a little more explicit before continuing.

"The application was not able to load. Please ensure that all packages are included in the project and that they are built according to Lambda's needs."

or something like that.

Steps to Reproduce

  1. Setup a flask app that imports a lib that isn't in the project.

Your Environment

  • Zappa version used:
  • Operating System and Python version:
  • The output of pip freeze:
  • Link to your project (optional):
  • Your zappa_settings.py:

jneves avatar Feb 20 '21 08:02 jneves

Re-raising this issue to be the main issue to address `"NoneType' object is not callable" issues.

monkut avatar Jul 19 '22 05:07 monkut

Hi there! Unfortunately, this Issue has not seen any activity for at least 90 days. If the Issue is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.

github-actions[bot] avatar Apr 03 '24 14:04 github-actions[bot]

Hi there! Unfortunately, this Issue was automatically closed as it had not seen any activity in at least 100 days. If the Issue is still relevant to the latest version of Zappa, please open a new Issue.

github-actions[bot] avatar Apr 13 '24 15:04 github-actions[bot]