-
Notifications
You must be signed in to change notification settings - Fork 30
Closed as not planned
Description
I'm trying to catch and work with an Error, but don't know for sure what I'm receiving in the exception. If I test using Error.fromException
and that fails and returns None
I want to throw it again, but I can't. I need to use the OCaml raise
function which seems to be available to me. Maybe the type of Error.raise
needs to be loosened? Do we need an Error.raiseAny
?
let f = () => {
try {
Console.log("do things")
} catch {
| _ as e =>
switch e->Error.fromException {
| Some(x) => Console.log("Handled!")
| None => Error.raise(e) // Compile error, expects an Error.t
| None => raise(e) // Works!
}
}
}
Metadata
Metadata
Assignees
Labels
No labels