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[:success] = true
|
||||||
@response[:message] = t("messages.friend.create.okay")
|
@response[:message] = t("messages.friend.create.okay")
|
||||||
rescue Errors::Base
|
rescue Errors::Base => e
|
||||||
@response[:message] = t("messages.answer.create.fail")
|
@response[:message] = t(e.locale_tag)
|
||||||
ensure
|
ensure
|
||||||
return_response
|
return_response
|
||||||
end
|
end
|
||||||
|
@ -31,8 +31,8 @@ class Ajax::RelationshipController < AjaxController
|
||||||
)
|
)
|
||||||
@response[:success] = true
|
@response[:success] = true
|
||||||
@response[:message] = t("messages.friend.destroy.okay")
|
@response[:message] = t("messages.friend.destroy.okay")
|
||||||
rescue Errors::Base
|
rescue Errors::Base => e
|
||||||
@response[:message] = t("messages.friend.destroy.fail")
|
@response[:message] = t(e.locale_tag)
|
||||||
ensure
|
ensure
|
||||||
return_response
|
return_response
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue