Skip to content

Commit

Permalink
Use Exception.message
Browse files Browse the repository at this point in the history
  • Loading branch information
thiamsantos committed Aug 9, 2019
1 parent 40cd5cd commit 2cfd0bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/avrora/encoder.ex
Expand Up @@ -83,7 +83,7 @@ defmodule Avrora.Encoder do

{:ok, decoded}
rescue
error in ErlangError -> {:error, error.original}
error -> {:error, Exception.message(error)}
end

defp do_encode(schema, payload) do
Expand All @@ -95,6 +95,6 @@ defmodule Avrora.Encoder do

{:ok, encoded}
rescue
error in ErlangError -> {:error, error.original}
error -> {:error, Exception.message(error)}
end
end

0 comments on commit 2cfd0bf

Please sign in to comment.