Skip to content

Commit

Permalink
Fix incomplete patterns.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Hamilton committed Nov 22, 2020
1 parent 6df35ac commit ec49d94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions IHP/AutoRefresh.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ autoRefresh runAction = do
registerNotificationTrigger ?touchedTables autoRefreshServer

throw exception
_ -> error "Unimplemented WAI response type."

runAction `Exception.catch` handleResponse
AutoRefreshEnabled {} -> do
Expand Down Expand Up @@ -109,6 +110,7 @@ instance WSApp AutoRefreshWSApp where
when (html /= lastResponse) do
updateSession sessionId (\session -> session { lastResponse = html })
sendTextData html
_ -> error "Unimplemented WAI response type."

async $ forever do
MVar.takeMVar event
Expand Down
1 change: 1 addition & 0 deletions IHP/WebSocket.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ startWSApp connection = do
let
handleException Websocket.ConnectionClosed = onClose @state
handleException (Websocket.CloseRequest {}) = onClose @state
handleException e = error ("Unhandled Websocket exception: " <> show e)
result <- Exception.try ((Websocket.withPingThread connection 30 (onPing @state) (run @state)) `Exception.catch` handleException)
case result of
Left (Exception.SomeException e) -> putStrLn (tshow e)
Expand Down

0 comments on commit ec49d94

Please sign in to comment.