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

Print original stacktrace on debug errors #83

Merged
merged 1 commit into from
Aug 1, 2016

Conversation

jamesls
Copy link
Member

@jamesls jamesls commented Aug 1, 2016

Before:

{
    "errorMessage": "Raising an exception!",
    "errorType": "RuntimeError",
    "stackTrace": [
        [
            "/var/task/chalice/__init__.py",
            198,
            "__call__",
            "raise e"
        ]
    ]
}

After:

{
    "errorMessage": "Raising an exception!",
    "errorType": "RuntimeError",
    "stackTrace": [
        [
            "/var/task/chalice/__init__.py",
            192,
            "__call__",
            "response = view_function(*function_args)"
        ],
        [
            "/var/task/app.py",
            9,
            "index",
            "return a()"
        ],
        [
            "/var/task/app.py",
            12,
            "a",
            "return b()"
        ],
        [
            "/var/task/app.py",
            15,
            "b",
            "raise RuntimeError(\"Raising an exception!\")"
        ]
    ]
}

This also shows up in chalice logs:

2016-08-01 16:14:06.897000 dcd6c3 Raising an exception!: RuntimeError
Traceback (most recent call last):
  File "/var/task/chalice/__init__.py", line 192, in __call__
    response = view_function(*function_args)
  File "/var/task/app.py", line 9, in index
    return a()
  File "/var/task/app.py", line 12, in a
    return b()
  File "/var/task/app.py", line 15, in b
    raise RuntimeError("Raising an exception!")
RuntimeError: Raising an exception!

Fixes #50.

Before:

```
{
    "errorMessage": "Raising an exception!",
    "errorType": "RuntimeError",
    "stackTrace": [
        [
            "/var/task/chalice/__init__.py",
            198,
            "__call__",
            "raise e"
        ]
    ]
}
```

After:
```
{
    "errorMessage": "Raising an exception!",
    "errorType": "RuntimeError",
    "stackTrace": [
        [
            "/var/task/chalice/__init__.py",
            192,
            "__call__",
            "response = view_function(*function_args)"
        ],
        [
            "/var/task/app.py",
            9,
            "index",
            "return a()"
        ],
        [
            "/var/task/app.py",
            12,
            "a",
            "return b()"
        ],
        [
            "/var/task/app.py",
            15,
            "b",
            "raise RuntimeError(\"Raising an exception!\")"
        ]
    ]
}
```

This also shows up in `chalice logs`:

```
2016-08-01 16:14:06.897000 dcd6c3 Raising an exception!: RuntimeError
Traceback (most recent call last):
  File "/var/task/chalice/__init__.py", line 192, in __call__
    response = view_function(*function_args)
  File "/var/task/app.py", line 9, in index
    return a()
  File "/var/task/app.py", line 12, in a
    return b()
  File "/var/task/app.py", line 15, in b
    raise RuntimeError("Raising an exception!")
RuntimeError: Raising an exception!
```

Fixes aws#50.
@jamesls jamesls merged commit 8af8151 into aws:master Aug 1, 2016
@woodlandh
Copy link

woodlandh commented Aug 2, 2016

Thanks for implementing this @jamesls !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants