cmu-delphi / exploration-tooling

tools for evaluating and exploring forecasters
Other
0 stars 0 forks source link

Improve debugging and tracebacks from pipeline errors #41

Closed dshemetov closed 3 weeks ago

dshemetov commented 11 months ago

When targets fails, it often doesn't provide a full traceback, but only a final error message. Can we improve this? Can we have this even with parallelization?

Part of a broader issue to improve debugging and error handling.

dshemetov commented 11 months ago

This might be helpful:

dshemetov commented 10 months ago

Added some code to forecaster_pred that puts you in browser or dumps vars on error. But this should probably be refactored later.

@brookslogan suggests withCallingHandlers

asdf = function() {x = 42; stop("SOIEJFIOJ")}
withCallingHandlers(asdf(), error = function(e) {recover()})

Enter a frame number, or 0 to exit   

1: withCallingHandlers(asdf(), error = function(e) {
    recover()
})
2: asdf()
3: #1: stop("SOIEJFIOJ")
4: .handleSimpleError(function (e) 
{
    recover()
}, "SOIEJFIOJ", base::quote(a
5: h(simpleError(msg, call))

Other options: globalCallingHandlers or something from rlang or a specific epipredict PR or options(error = ).

purrr::auto_browse is neat, but often doesn't drop you where you actually want to debug.

dshemetov commented 3 weeks ago

Improved considerably since and with #122