diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-09-17 17:03:36 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-09-17 17:03:36 +0200 |
commit | 0e9c1a297aa15570d87da356f2ac908f1fd433a3 (patch) | |
tree | 1c8ab8e3115f6890229fe34a41e5c827d7dd1679 /app/controllers | |
parent | 8c0b19012bae203f41b75cf40d6baf121f67fdea (diff) |
Improved error handling for FollowRemoteService
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/api_controller.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index bacdd997b..cbe7141b9 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -10,6 +10,14 @@ class ApiController < ApplicationController render json: { error: 'Record not found' }, status: 404 end + rescue_from Goldfinger::Error do + render json: { error: 'Remote account could not be resolved' }, status: 422 + end + + rescue_from HTTP::Error do + render json: { error: 'Remote data could not be fetched' }, status: 503 + end + protected def current_resource_owner |