E2 Error Type #2807
Denneisk
started this conversation in
Suggestions
E2 Error Type
#2807
Replies: 1 comment 2 replies
-
|
The idea is interesting but the plan was always to eventually allow throwing arbitrary types. Also I don't think any other language includes backtraces with try catch |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Error type for errors instead of passing a string. Try/catch could still have a version for old string passing, but an error type would be nicer as, ideally, error type would also pass the entire trace and have a sort of type/ID system so you don't have to 1:1 compare every error message.
Suggested API:
error:startLine(),error:endLine(),error:startCol(),error:endCol()newError(string type, string message)E2 internals would also be converted to use error objects to ensure consistency.
Assuming E2 OOPs comes out before this does, I'm hoping that
try/catchcan be more typical to something like Java/C# where you have to specify the class of exception.Beta Was this translation helpful? Give feedback.
All reactions