File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ Notable changes to this project are documented in this file. The format is based
77Breaking changes:
88
99New features:
10+ - Add ` errorWithCause ` (#43 by @sigma-andex )
1011
1112Bugfixes:
1213
Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ export function error(msg) {
66 return new Error ( msg ) ;
77}
88
9+ export function errorWithCause ( msg ) {
10+ return function ( cause ) {
11+ return new Error ( msg , { cause } ) ;
12+ } ;
13+ }
14+
915export function message ( e ) {
1016 return e . message ;
1117}
Original file line number Diff line number Diff line change 33
44module Effect.Exception
55 ( Error
6+ , catchException
67 , error
8+ , errorWithCause
79 , message
810 , name
911 , stack
10- , throwException
11- , catchException
1212 , throw
13+ , throwException
1314 , try
14- ) where
15+ )
16+ where
1517
1618import Prelude
1719
@@ -31,6 +33,9 @@ foreign import showErrorImpl :: Error -> String
3133-- | Create a JavaScript error, specifying a message
3234foreign import error :: String -> Error
3335
36+ -- | Create a JavaScript error, specifying a message and a cause
37+ foreign import errorWithCause :: String -> Error -> Error
38+
3439-- | Get the error message from a JavaScript error
3540foreign import message :: Error -> String
3641
You can’t perform that action at this time.
0 commit comments