<#4777 [Core feature] Include exception type in er...
# flytekit
a
#4777 [Core feature] Include exception type in error messages Issue created by Tom-Newton Motivation: Why do you think this is important? Sometimes we see error messages that look very confusing. e.g.
Copy code
Traceback (most recent call last):

      File "flytekit/exceptions/scopes.py", line 206, in user_entry_point
        return wrapped(*args, **kwargs)
      File "<file.py>", line 158, in <task>
        dictionary[variable](**kwargs)

Message:

    ''

User error.
(This is a redacted version of a real error message we've seen on flyte) This is confusing because its missing
KeyError
. Initially I was thinking there was some bug causing us to only get half a traceback. Goal: What should the final outcome look like, ideally? The example traceback from above should look something like this:
Copy code
Traceback (most recent call last):

      File "flytekit/exceptions/scopes.py", line 206, in user_entry_point
        return wrapped(*args, **kwargs)
      File "<file.py>", line 158, in <task>
        dictionary[variable](**kwargs)

Message:

    KeyError: ''

User error.
Describe alternatives you've considered Exact formatting of the message is open for debate but I can't think of any convenient alternative to know that this example was a
KeyError
. Propose: Link/Inline OR Additional context I can make a PR. Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte