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
|
end
|
||||||
|
|
||||||
def read_file!(decoder, file, opts \\ []) do
|
def read_file!(decoder, file, opts \\ []) do
|
||||||
case read_file(decoder, file, opts) do
|
with content = File.read!(file) do
|
||||||
{:ok, graph} -> graph
|
read_string!(decoder, content, opts)
|
||||||
{:error, reason} -> raise File.Error, path: file, action: "read", reason: reason
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue