File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 44
55### Types
66
7- type Error = { stack :: String, message :: String }
7+ data Error :: *
88
99 data Exception :: !
1010
1313
1414 catchException :: forall a eff. (Error -> Eff eff a) -> Eff (err :: Exception | eff) a -> Eff eff a
1515
16+ error :: String -> Error
17+
18+ message :: Error -> String
19+
20+ stackTrace :: Error -> String
21+
1622 throwException :: forall a eff. Error -> Eff (err :: Exception | eff) a
Original file line number Diff line number Diff line change @@ -4,7 +4,22 @@ import Control.Monad.Eff
44
55foreign import data Exception :: !
66
7- type Error = { message :: String , stack :: String }
7+ foreign import data Error :: *
8+
9+ foreign import message
10+ " function message(e) {\
11+ \ return e.message;\
12+ \}" :: Error -> String
13+
14+ foreign import stackTrace
15+ " function stack(e) {\
16+ \ return e.stack;\
17+ \}" :: Error -> String
18+
19+ foreign import error
20+ " function error(msg) {\
21+ \ return new Error(msg);\
22+ \}" :: String -> Error
823
924foreign import throwException
1025 " function throwException(e) {\
You can’t perform that action at this time.
0 commit comments