Skip to content

Commit

Permalink
refactor: use raise/3
Browse files Browse the repository at this point in the history
Co-authored-by: zmstone <zmstone@gmail.com>
  • Loading branch information
thalesmg and zmstone authored Jun 5, 2024
1 parent 68432a3 commit 092f3fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hocon_schema.erl
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ fields_and_meta(Mod, Name) when is_atom(Mod) ->
ensure_struct_meta(Fields)
catch
K:E:S ->
throw(#{kind => K, reason => E, stacktrace => S})
erlang:raise(K, #{error => "failed to resolve schema", cause => E, schema_module => Mod, struct_name => Name}, S)
end,
Meta#{tags => tags(Mod)};
fields_and_meta(#{fields := Fields}, Name) when is_function(Fields) ->
Expand All @@ -300,7 +300,7 @@ maybe_add_desc(Mod, Name, Meta) ->
Meta#{desc => Desc}
catch
K:E:S ->
throw(#{kind => K, reason => E, stacktrace => S})
erlang:raise(K, #{error => "failed to resolve struct description", cause => E, schema_module => Mod, struct_name => Name}, S)
end;
false ->
Meta
Expand Down

0 comments on commit 092f3fd

Please sign in to comment.