Fix error messages on connection failure for postgres on localized Windows

This commit is contained in:
Wolfgang Walther
2020-10-03 10:11:41 -05:00
committed by Steve Chavez
parent 17f04a886e
commit d395bb6052
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -18,6 +18,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- #1530, Fix how the PostgREST version is shown in the help text when the `.git` directory is not available - @monacoremo
- #1094, Fix expired JWTs starting an empty transaction on the db - @steve-chavez
- #1475, Fix location header for POST request with select= without PK (#1162) - @wolfgangwalther
- #1599, Fix error messages on connection failure for localized postgres on Windows (#1585) - @wolfgangwalther
### Changed
+2 -2
View File
@@ -28,7 +28,7 @@ import Network.HTTP.Types.Header
import PostgREST.Types
import Protolude hiding (toS)
import Protolude.Conv (toS)
import Protolude.Conv (toS, toSL)
class (JSON.ToJSON a) => PgrstError a where
@@ -133,7 +133,7 @@ instance JSON.ToJSON P.UsageError where
toJSON (P.ConnectionError e) = JSON.object [
"code" .= ("" :: Text),
"message" .= ("Database connection error. Retrying the connection." :: Text),
"details" .= (toS $ fromMaybe "" e :: Text)]
"details" .= (toSL $ fromMaybe "" e :: Text)]
toJSON (P.SessionError e) = JSON.toJSON e -- H.Error
instance JSON.ToJSON H.QueryError where