Skip to content

Commit

Permalink
Show database outdated error screen if column is missing exception is…
Browse files Browse the repository at this point in the history
… thrown
  • Loading branch information
mpscholten committed Sep 27, 2021
1 parent 0a2cbdb commit dcce5b5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions IHP/ErrorController.hs
Expand Up @@ -173,6 +173,10 @@ postgresHandler exception controller additionalInfo = do
| "relation" `ByteString.isPrefixOf` (get #sqlErrorMsg exception)
&& "does not exist" `ByteString.isSuffixOf` (get #sqlErrorMsg exception)
-> Just (handlePostgresError exception "A table is missing.")
Just (exception :: PG.SqlError)
| "column" `ByteString.isPrefixOf` (get #sqlErrorMsg exception)
&& "does not exist" `ByteString.isSuffixOf` (get #sqlErrorMsg exception)
-> Just (handlePostgresError exception "A column is missing.")
_ -> Nothing

patternMatchFailureHandler :: (Show controller, ?context :: ControllerContext) => SomeException -> controller -> Text -> Maybe (IO ResponseReceived)
Expand Down

0 comments on commit dcce5b5

Please sign in to comment.