Skip to content

Commit 498c2b5

Browse files
committed
Build errors from hashes.
1 parent 369f5c8 commit 498c2b5

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
@@ -25,6 +25,8 @@ def self.render(errors, options)
2525
error
2626
elsif error.is_a?(ActiveModel::Errors)
2727
ActiveModelErrors.new(error, options[:_reverse_mapping]).to_a
28+
elsif error.is_a?(Hash)
29+
JSONAPI::Serializable::Error.create(error)
2830
else
2931
raise # TODO(lucas): Raise meaningful exception.
3032
end

0 commit comments

Comments
 (0)