Skip to content

Commit c1b8e37

Browse files
Add coercion to normal error
1 parent f78d827 commit c1b8e37

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Node/Errors/SystemError.purs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Node.Errors.SystemError
22
( SystemError
3+
, toError
34
, address
45
, code
56
, dest
@@ -17,11 +18,15 @@ import Prelude
1718
import Data.Function.Uncurried (Fn2, runFn2)
1819
import Data.Maybe (Maybe)
1920
import Data.Nullable (Nullable, toMaybe)
21+
import Effect.Exception (Error)
2022
import Foreign (Foreign)
2123
import Unsafe.Coerce (unsafeCoerce)
2224

2325
foreign import data SystemError :: Type
2426

27+
toError :: SystemError -> Error
28+
toError = unsafeCoerce
29+
2530
instance Show SystemError where
2631
show = unsafeCoerce
2732

0 commit comments

Comments
 (0)