fix missing cases in async handling
commit111ec3dafff9d8dec9c631dc517042311dfb9cf5
authorAgentM <agentm@themactionfaction.com>
dateSat 4 Feb 2017, 00:17 (10 years ago)
parentd4ddf8c
src/lib/ProjectM36/Error.hs+2−1
@@ -123,5 +123,6 @@ data SchemaError = RelVarReferencesMissing (S.Set RelVarName) |
123123
124124
125125-- errors returned from the distributed-process call handlers
126−data ServerError = RequestTimeoutError
126+data ServerError = RequestTimeoutError |
127+ ProcessDiedError String
127128 deriving (Generic, Binary, Eq)
src/lib/ProjectM36/Server/EntryPoints.hs+3
@@ -23,6 +23,9 @@ timeoutOrDie micros act = do
2323 case asyncRes of
2424 AsyncDone x -> pure (Right x)
2525 AsyncCancelled -> pure (Left RequestTimeoutError)
26+ AsyncFailed reason -> pure (Left (ProcessDiedError (show reason)))
27+ AsyncLinkFailed reason -> pure (Left (ProcessDiedError (show reason)))
28+ AsyncPending -> pure (Left (ProcessDiedError "process pending"))
2629
2730type Timeout = Int
2831