Replies: 2 comments
-
EDIT: It is now working - see below. |
Beta Was this translation helpful? Give feedback.
-
Actually, I just now tried it out again, and suddenly it is working with this version of the compiler: $ moon version --all
moon 0.1.20250107 (099c4c7 2025-01-07) ~/.moon/bin/moon
moonc v0.1.20250108+7a6b9ab0e ~/.moon/bin/moonc
moonrun 0.1.20250107 (099c4c7 2025-01-07) ~/.moon/bin/moonrun so please feel free to close this discussion. |
Beta Was this translation helpful? Give feedback.
-
Currently,
Error
represents an error where no information can be extracted from it unless it is pattern-matched explicitly against a known collection of possible errors. (Please correct me if I'm wrong.)What if
Error
and all custom error types created bytype!
were forced to provide ato_string
method so that no matter what kind of error happens, information can be shown to the user about the specific error?Wouldn't this dramatically simplify all error handling by enabling all functions that might error to simply return
T!Error
and then at some point up the call chain the error can be handled andto_string()
can be called to report the error?Beta Was this translation helpful? Give feedback.
All reactions