Add Sentry info if returning unprocessable_entity

This commit is contained in:
Sebastian Serth
2020-11-11 17:42:20 +01:00
parent 664dadf404
commit 807b763e49

View File

@ -27,6 +27,11 @@ module CommonBehavior
def respond_with_invalid_object(format, options = {})
format.html { render(options[:template]) }
format.json { render(json: @object.errors, status: :unprocessable_entity) }
begin
@object.save!
rescue StandardError => e
Raven.capture_exception e
end
end
def respond_with_valid_object(format, options = {})