-
Notifications
You must be signed in to change notification settings - Fork 323
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
Better Error Trapping in map
#8110
Comments
The behavior we want is something like this?
In other words, if we are catching the specific error On the other hand, if we don't catch |
Greg Travis reports a new STANDUP for today (2023-11-08): Progress: reviews; make ide run; ci problems; tests for 8110 It should be finished by 2023-11-15. Next Day: 8110 |
Exactly 💯 We don't want to abuse the type hierarchy to somehow make Additionally, we don't want Instead, the proposed solution was to create a special
to which we can provide conversions. Then we can:
and the catch self (error_type = Any) (handler = x->x) =
self.catch_primitive error_value->
case error_value.is_a error_type of
True -> handler error_value
- False -> self
+ False ->
+ # TODO this is a prototype - it wrongly handles edge cases if we had a Nothing wrapped as error which is not forbidden
+ wrapped = Panic.catch No_Such_Conversion (Wrapped_Error.from error_value . inner_error) _->Nothing
+ if wrapped.is_a error_type then handler error_value else self |
Greg Travis reports a new STANDUP for today (2023-11-09): Progress: got test suite passing, many questions left It should be finished by 2023-11-15. Next Day: 8110 |
Greg Travis reports a new STANDUP for today (2023-11-10): Progress: rewrote to use original java; handled nested wrapping; Error_Spec tests; many stack overflows It should be finished by 2023-11-15. Next Day: get all tests passing |
Greg Travis reports a new STANDUP for today (2023-11-13): Progress: fixing tests; stack overflows It should be finished by 2023-11-15. Next Day: get all tests passing |
Greg Travis reports a new STANDUP for today (2023-11-14): Progress: fixing tests; warning doubling It should be finished by 2023-11-15. Next Day: get all tests passing |
Greg Travis reports a new 🔴 DELAY for today (2023-11-15): Summary: There is 1 days delay in implementation of the Better Error Trapping in Delay Cause: unexpectedly complicated |
Greg Travis reports a new STANDUP for today (2023-11-15): Progress: warning double with Humbert; misc It should be finished by 2023-11-16. Next Day: warning doubling |
Greg Travis reports a new 🔴 DELAY for today (2023-11-16): Summary: There is 1 days delay in implementation of the Better Error Trapping in Delay Cause: nested wrappers |
Greg Travis reports a new STANDUP for today (2023-11-16): Progress: nested wrappers It should be finished by 2023-11-17. Next Day: tests passing |
Greg Travis reports a new 🔴 DELAY for today (2023-11-20): Summary: There is 4 days delay in implementation of the Better Error Trapping in Delay Cause: nested wrappers |
Greg Travis reports a new STANDUP for today (2023-11-20): Progress: nested wrappers It should be finished by 2023-11-21. Next Day: tests passing |
Greg Travis reports a new 🔴 DELAY for today (2023-11-21): Summary: There is 1 days delay in implementation of the Better Error Trapping in Delay Cause: nested wrappers |
Greg Travis reports a new STANDUP for today (2023-11-21): Progress: nested wrappers It should be finished by 2023-11-22. Next Day: tests passing |
Greg Travis reports a new 🔴 DELAY for today (2023-11-22): Summary: There is 1 days delay in implementation of the Better Error Trapping in Delay Cause: nested wrappers |
Greg Travis reports a new 🔴 DELAY for today (2023-11-22): Summary: There is 4 days delay in implementation of the Better Error Trapping in Delay Cause: nested wrappers |
Greg Travis reports a new STANDUP for today (2023-11-22): Progress: nested wrappers It should be finished by 2023-11-27. Next Day: tests passing |
Greg Travis reports a new 🔴 DELAY for today (2023-11-27): Summary: There is 1 days delay in implementation of the Better Error Trapping in Delay Cause: nested wrappers |
Greg Travis reports a new STANDUP for today (2023-11-27): Progress: cleanup, docs, tests It should be finished by 2023-11-28. Next Day: benchmarks |
Greg Travis reports a new 🔴 DELAY for today (2023-11-28): Summary: There is 1 days delay in implementation of the Better Error Trapping in Delay Cause: review |
Greg Travis reports a new STANDUP for today (2023-11-28): Progress: benchmarks, review It should be finished by 2023-11-29. Next Day: review |
Currently if an error occurs when running a
map
function the whole process fails and it is difficult to know what record it failed on.This is a first ticket to add this kind of handling to functions like map. Others will want it as well.
To improve this want to add user controllable error handling:
On the
map
method we should addon_problems
parameter. Unlike other methods, it should default toError
notWarning
.Ignore
, the error should be dropped and aNothing
value placed in output.Warning
, the error from the function should caught, wrapped as below, and attached as a warning to the result.Nothing
should be in the position. Count the warnings and if above 10 (or whatever I current threshold is) attach an Additional Warnings warning.Error
, the error should be raised but with error wrapping below.The
Map_Error
wraps the failure with the index allowing for easy discovery.The
is_a
workaround is not recommended. Instead a review ofError.catch
and allowing it to convert the caught error to a custom type (e.g.Wrapped_Error
) which can then be tested against cleanly. If catching a specific type, then we should unwrap it.The text was updated successfully, but these errors were encountered: