0
0
Fork 0

Improved error handling for FollowRemoteService

This commit is contained in:
Eugen Rochko 2016-09-17 17:03:36 +02:00
parent 8c0b19012b
commit 0e9c1a297a
3 changed files with 29 additions and 11 deletions

View file

@ -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