File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -19,29 +19,29 @@ foreign import error
1919 \ return new Error(msg);\
2020 \};" :: String -> Error
2121
22- foreign import message
22+ foreign import message
2323 " function message(e) {\
2424 \ return e.message;\
2525 \}" :: Error -> String
26-
27- foreign import throwException
26+
27+ foreign import throwException
2828 " function throwException(e) {\
2929 \ return function() {\
3030 \ throw e;\
3131 \ };\
3232 \}" :: forall a eff . Error -> Eff (err :: Exception | eff ) a
3333
34- foreign import catchException
34+ foreign import catchException
3535 " function catchException(c) {\
3636 \ return function(t) {\
3737 \ return function() {\
3838 \ try {\
3939 \ return t();\
4040 \ } catch(e) {\
41- \ if (e instanceof Error) {\
41+ \ if (e instanceof Error || {}.toString.call(e) === '[object Error]' ) {\
4242 \ return c(e)();\
4343 \ } else {\
44- \ throw e ;\
44+ \ return c(new Error(e.toString()))() ;\
4545 \ }\
4646 \ }\
4747 \ };\
You can’t perform that action at this time.
0 commit comments