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

Custom Error Handling #1

Open
2 tasks
pgierz opened this issue Apr 7, 2020 · 1 comment
Open
2 tasks

Custom Error Handling #1

pgierz opened this issue Apr 7, 2020 · 1 comment

Comments

@pgierz
Copy link
Member

pgierz commented Apr 7, 2020

We need to have some custom error messages to better handle typical user issues:

  • Choose blocks
  • variable expansions

@dbarbi: maybe we can add to this list

An idea would be:

class EsmParserError(Exception):
   pass # PG: Still need to figure out how this works. See ScriptEngine for an example...

raise EsmParserError("A choose block was not used correctly...")
@pgierz
Copy link
Member Author

pgierz commented Apr 7, 2020

Just checked ScriptEngine, it does exactly this:

"""ScriptEngine exceptions
"""

class ScriptEngineStopException(Exception):
    """Raise this exception when ScriptEngine should stop"""

So, we can put a custom error message like I showed above and at least throw our own errors rather than relying on the Python built-in ones.

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

No branches or pull requests

1 participant