File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ module Node.ChildProcess
11
11
, send
12
12
, disconnect
13
13
, Error ()
14
+ , toStandardError
14
15
, Exit (..)
15
16
, onExit
16
17
, onClose
@@ -32,6 +33,7 @@ import Prelude
32
33
import Control.Alt ((<|>))
33
34
import Control.Bind ((>=>))
34
35
import Control.Monad.Eff (Eff ())
36
+ import Control.Monad.Eff.Exception as Exception
35
37
import Control.Monad.Eff.Exception.Unsafe (unsafeThrow )
36
38
37
39
import Data.StrMap (StrMap ())
@@ -212,6 +214,11 @@ type Error =
212
214
, syscall :: String
213
215
}
214
216
217
+ -- | Convert a ChildProcess.Error to a standard Error, which can then be thrown
218
+ -- | inside an Eff or Aff computation (for example).
219
+ toStandardError :: Error -> Exception.Error
220
+ toStandardError = unsafeCoerce
221
+
215
222
-- | Behaviour for standard IO streams (eg, standard input, standard output) of
216
223
-- | a child process.
217
224
-- |
You can’t perform that action at this time.
0 commit comments