Skip to content

Conversation

pepeiborra
Copy link

Error handling doesn't currently work with forkServer:

do
  s <- Just <$> forkServer "localhost" 8000 `catchAny` \e -> pure Nothing

The above code will not manage to deal with "port already in use" or similar, since the exceptions are being thrown asynchronously to the main thread.

To address that we use an Async to hold the server, so there's no longer a need to throw the exception back to the main thread.

Error handling doesn't currently work with `forkServer`:
```
do
  s <- Just <$> forkServer "localhost" 8000 `catchAny` \e -> pure Nothing
```

The above code will not manage to deal with "port already in use" or similar, since the exceptions are being thrown asynchronously to the main thread.

To address that we use an Async to hold the server, so there's no longer a need to throw the exception back to the main thread.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant