Skip to content

Commit

Permalink
Replace raise with reraise
Browse files Browse the repository at this point in the history
  • Loading branch information
robacourt committed Jul 1, 2024
1 parent 6545a4e commit dfb94aa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions components/electric/lib/electric/satellite/serialization.ex
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,10 @@ defmodule Electric.Satellite.Serialization do

val
rescue
_ -> raise DataValidationError, message: "Unexpected value for :date column: #{inspect(val)}"
_ ->
reraise DataValidationError,
[message: "Unexpected value for :date column: #{inspect(val)}"],
__STACKTRACE__
end

def decode_column_value!(val, type) when type in [:float4, :float8] do
Expand Down Expand Up @@ -641,7 +644,10 @@ defmodule Electric.Satellite.Serialization do

val
rescue
_ -> raise DataValidationError, message: "Unexpected value for :time column: #{inspect(val)}"
_ ->
reraise DataValidationError,
[message: "Unexpected value for :time column: #{inspect(val)}"],
__STACKTRACE__
end

def decode_column_value!(val, :timestamp) do
Expand Down

0 comments on commit dfb94aa

Please sign in to comment.