Skip to content

Commit

Permalink
Make error message obvious that it came from the server
Browse files Browse the repository at this point in the history
  • Loading branch information
robacourt committed Jul 1, 2024
1 parent b6330d5 commit 0f280cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clients/typescript/src/util/proto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export function serverErrorToSatelliteError(
): SatelliteError {
return new SatelliteError(
serverErrorToSatError[error.errorType],
error.message
'Server error: ' + error.message
)
}

Expand Down
2 changes: 1 addition & 1 deletion components/electric/lib/electric/satellite/protocol.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1353,5 +1353,5 @@ defmodule Electric.Satellite.Protocol do
defp decode_sql_dialect(:POSTGRES), do: Electric.Postgres.Dialect.Postgresql

defp friendly_error_message(%DataValidationError{} = error), do: Exception.message(error)
defp friendly_error_message(_), do: "server error"
defp friendly_error_message(_), do: "unexpected error"
end

0 comments on commit 0f280cc

Please sign in to comment.