From a5fc5aa6071baa1e91d656a3047815c24b59d41f Mon Sep 17 00:00:00 2001 From: Marcel Otto Date: Mon, 15 May 2017 22:48:55 +0200 Subject: [PATCH] core: fix read_file! to propagate parsing errors properly --- lib/rdf/serialization/reader.ex | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/rdf/serialization/reader.ex b/lib/rdf/serialization/reader.ex index 8005fe9..ac32860 100644 --- a/lib/rdf/serialization/reader.ex +++ b/lib/rdf/serialization/reader.ex @@ -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