Skip to content

Commit 85b8249

Browse files
committed
Build errors from hashes.
1 parent 647b83e commit 85b8249

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/jsonapi/rails/renderer.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def render(errors, options)
3737
error
3838
elsif error.is_a?(ActiveModel::Errors)
3939
ActiveModelErrors.new(error, options[:_reverse_mapping]).to_a
40+
elsif error.is_a?(Hash)
41+
JSONAPI::Serializable::Error.create(error)
4042
else
4143
raise # TODO(lucas): Raise meaningful exception.
4244
end

0 commit comments

Comments
 (0)