about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/api_controller.rb8
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