Use generic handling of our own exceptions
Noticed that we shouldn't be trying to catch specific exceptions as `Dry::Types` will throw its own exceptions for validation errors.
This commit is contained in:
parent
29d46b43db
commit
677ce26e6c
|
@ -17,8 +17,8 @@ class Ajax::RelationshipController < AjaxController
|
|||
)
|
||||
@response[:success] = true
|
||||
@response[:message] = t("messages.friend.create.okay")
|
||||
rescue Errors::Base
|
||||
@response[:message] = t("messages.answer.create.fail")
|
||||
rescue Errors::Base => e
|
||||
@response[:message] = t(e.locale_tag)
|
||||
ensure
|
||||
return_response
|
||||
end
|
||||
|
@ -31,8 +31,8 @@ class Ajax::RelationshipController < AjaxController
|
|||
)
|
||||
@response[:success] = true
|
||||
@response[:message] = t("messages.friend.destroy.okay")
|
||||
rescue Errors::Base
|
||||
@response[:message] = t("messages.friend.destroy.fail")
|
||||
rescue Errors::Base => e
|
||||
@response[:message] = t(e.locale_tag)
|
||||
ensure
|
||||
return_response
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue