Skip to content

Commit

Permalink
fix: remove verbosity from some error logs
Browse files Browse the repository at this point in the history
Error logs starting with "An error occured..." are replaced with "Failed to..."
  • Loading branch information
laurenceisla committed May 21, 2024
1 parent 7671d63 commit c68d8a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/PostgREST/CLI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ dumpSchema appState = do
(transaction SQL.ReadCommitted SQL.Read $ querySchemaCache conf)
case result of
Left e -> do
hPutStrLn stderr $ "An error ocurred when loading the schema cache:\n" <> show e
hPutStrLn stderr $ "Failed to load the schema cache:\n" <> show e
exitFailure
Right sCache -> return $ JSON.encode sCache

Expand Down
6 changes: 3 additions & 3 deletions src/PostgREST/Observation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ observationMessage = \case
ExitDBFatalError ServerError08P01 usageErr ->
"Connection poolers in statement mode are not supported." <> jsonMessage usageErr
SchemaCacheErrorObs usageErr ->
"An error ocurred when loading the schema cache. " <> jsonMessage usageErr
"Failed to load the schema cache. " <> jsonMessage usageErr
SchemaCacheQueriedObs resultTime ->
"Schema cache queried in " <> showMillis resultTime <> " milliseconds"
SchemaCacheSummaryObs summary ->
Expand All @@ -112,9 +112,9 @@ observationMessage = \case
DBListenerGotConfigMsg channel ->
"Received a config reload message on the " <> show channel <> " channel"
ConfigReadErrorObs usageErr ->
"An error ocurred when trying to query database settings for the config parameters." <> jsonMessage usageErr
"Failed to query database settings for the config parameters." <> jsonMessage usageErr
QueryRoleSettingsErrorObs usageErr ->
"An error ocurred when trying to query the role settings. " <> jsonMessage usageErr
"Failed to query the role settings. " <> jsonMessage usageErr
QueryErrorCodeHighObs usageErr ->
jsonMessage usageErr
ConfigInvalidObs err ->
Expand Down

0 comments on commit c68d8a9

Please sign in to comment.