File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ exports.message = function (e) {
1212 return e . message ;
1313} ;
1414
15+ exports . name = function ( e ) {
16+ return e . name || "Error" ;
17+ } ;
18+
1519exports . stackImpl = function ( just ) {
1620 return function ( nothing ) {
1721 return function ( e ) {
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ module Control.Monad.Eff.Exception
66 , Error
77 , error
88 , message
9+ , name
910 , stack
1011 , throwException
1112 , catchException
@@ -37,6 +38,9 @@ foreign import error :: String -> Error
3738-- | Get the error message from a JavaScript error
3839foreign import message :: Error -> String
3940
41+ -- | Get the error name when defined, or fallback to 'Error'
42+ foreign import name :: Error -> String
43+
4044-- | Get the stack trace from a JavaScript error
4145stack :: Error -> Maybe String
4246stack = stackImpl Just Nothing
You can’t perform that action at this time.
0 commit comments