Don't rescue from FunctionClauseErrors in readers and writers

This commit is contained in:
Marcel Otto 2021-09-03 14:15:04 +02:00
parent 7d4280ec9a
commit 266ca1f159
2 changed files with 2 additions and 0 deletions

View file

@ -62,6 +62,7 @@ defmodule RDF.Serialization.Reader do
|> File.stream!(file_mode(decoder, opts))
|> decoder.decode_from_stream(opts)
rescue
error in FunctionClauseError -> reraise error, __STACKTRACE__
error in RuntimeError -> {:error, error.message}
error -> {:error, error}
end

View file

@ -39,6 +39,7 @@ defmodule RDF.Serialization.Writer do
:ok
rescue
error in FunctionClauseError -> reraise error, __STACKTRACE__
error in RuntimeError -> {:error, error.message}
error -> {:error, error}
end