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

narrow the exception types and pretty print exceptions #4

Open
thautwarm opened this issue Jan 31, 2020 · 0 comments
Open

narrow the exception types and pretty print exceptions #4

thautwarm opened this issue Jan 31, 2020 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@thautwarm
Copy link
Contributor

Currently, the exceptions are not well-rendered, and I just collect the error here,

self._loc = expr.loc
try:
ret = self.dispatches[expr.__class__](self, expr)
return ret
except Report:
,
and do some basic formatting at
except Report as e:
if debug:
traceback.print_exc(limit=tracing_limit)
.

Also, many exceptions raised when compiling are just this simple, without a proper exception type specified:

raise Exception("redefinition of operator properties")

To narrow the exception types, we might create a new module called excs, and make some new exception types in this module, for raising during compilation. The existing exception types might be migrated to excs module.

To pretty print the exceptions, we might create a method in excs to well render the exception to string message.

@thautwarm thautwarm added enhancement New feature or request help wanted Extra attention is needed labels Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant