core: fix read_file! to propagate parsing errors properly
This commit is contained in:
parent
8eb15b581b
commit
a5fc5aa607
1 changed files with 2 additions and 3 deletions
|
@ -31,9 +31,8 @@ defmodule RDF.Serialization.Reader do
|
|||
end
|
||||
|
||||
def read_file!(decoder, file, opts \\ []) do
|
||||
case read_file(decoder, file, opts) do
|
||||
{:ok, graph} -> graph
|
||||
{:error, reason} -> raise File.Error, path: file, action: "read", reason: reason
|
||||
with content = File.read!(file) do
|
||||
read_string!(decoder, content, opts)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue