Skip to content

Commit

Permalink
Fix error messages on connection failure for postgres on localized Wi…
Browse files Browse the repository at this point in the history
…ndows
  • Loading branch information
wolfgangwalther authored and steve-chavez committed Oct 3, 2020
1 parent 17f04a8 commit d395bb6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/PostgREST/Error.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d395bb6

Please sign in to comment.