From ec49d94a98a082832a305a6883dd3a26bdf999f9 Mon Sep 17 00:00:00 2001 From: Nick Hamilton Date: Mon, 23 Nov 2020 08:45:12 +1000 Subject: [PATCH] Fix incomplete patterns. --- IHP/AutoRefresh.hs | 2 ++ IHP/WebSocket.hs | 1 + 2 files changed, 3 insertions(+) diff --git a/IHP/AutoRefresh.hs b/IHP/AutoRefresh.hs index 7288251b1..b22b01e27 100644 --- a/IHP/AutoRefresh.hs +++ b/IHP/AutoRefresh.hs @@ -79,6 +79,7 @@ autoRefresh runAction = do registerNotificationTrigger ?touchedTables autoRefreshServer throw exception + _ -> error "Unimplemented WAI response type." runAction `Exception.catch` handleResponse AutoRefreshEnabled {} -> do @@ -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 diff --git a/IHP/WebSocket.hs b/IHP/WebSocket.hs index 0673b5e1e..e4794928f 100644 --- a/IHP/WebSocket.hs +++ b/IHP/WebSocket.hs @@ -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)