Skip to content

Commit

Permalink
Throw an error if an exception happens on value mapping.
Browse files Browse the repository at this point in the history
  • Loading branch information
mworrell committed Dec 7, 2021
1 parent 009537e commit 3751c80
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/rdf_triples.erl
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ compact(Doc, Namespaces) ->
Acc#{ <<"@type">> => ns_compact(V, Namespaces)};
(K, V, Acc) ->
K1 = ns_compact(K, Namespaces),
V1 = compact_value(V, Namespaces),
Acc#{ K1 => V1 }
try
V1 = compact_value(V, Namespaces),
Acc#{ K1 => V1 }
catch
_:_ ->
Uri = maps:get(<<"@id">>, Doc, undefined),
erlang:throw({illegal_triple_value, {Uri, K, V}})
end
end,
#{},
Doc).
Expand Down

0 comments on commit 3751c80

Please sign in to comment.