-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Create separate UserAssert for user input errors #26
Comments
I'm helping set up the Python bindings for trial use in Fredo's class. Promoting user input errors to some catchable mechanism would make the user experience in Python, in particular, much better (it could show at least a Python stack trace, and would not instantly |
By user input errors do you mean parameters that are bad or code that I'm guessing I'm missing something... On Wed, Nov 13, 2013 at 3:08 PM, Jonathan Ragan-Kelley <
|
This is a reference to our past private thread on “Halide error reporting.” I mean user input errors at the compiler API level (constructing IR or schedules that don’t make sense, or otherwise incorrectly using the interfaces). We throw asserts with error strings not just for “oh my god, the compiler is going to blow up” invariants we maintain internally, but also for bad inputs created by user code. It would be useful if these user-gave-us-something-bad errors followed a different path from our-code-confused-itself-internally asserts, in part so that the errors can be caught rather than exiting the host program. |
I’m glad to take an initial crack at it, if people buy that a trivial design is a worthwhile change. I’m just replacing existing asserts which relate mostly to user input with some alternate function like:
This function could:
I’m assuming (1) by default for now, with either Is this worthwhile, or would people rather continue waiting for a full rethink of the compiler error handling stack as discussed off-list in July? |
I buy that the trivial design is a worthwhile change. On Wed, Nov 13, 2013 at 3:34 PM, Jonathan Ragan-Kelley <
|
A prototype of a more extensive rework of error conditions is in the introspection branch. It does a superset of the above. |
merged into trunk in 525176e |
Much like. |
Currently, quite a few user errors result in assertions. These have been improved to be reasonably informative, but they should still be pushed off to a separate path from the implementation error asserts, specific to input program warnings and errors.
The text was updated successfully, but these errors were encountered: