summaryrefslogtreecommitdiff
path: root/app/controllers/api/errors_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/api/errors_controller.rb')
-rw-r--r--app/controllers/api/errors_controller.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/controllers/api/errors_controller.rb b/app/controllers/api/errors_controller.rb
new file mode 100644
index 0000000..09a7f16
--- /dev/null
+++ b/app/controllers/api/errors_controller.rb
@@ -0,0 +1,12 @@
+class API::ErrorsController < Api::Controller
+ include Gaffe::Errors
+ skip_before_action :authenticate!
+
+ layout false
+
+ def show
+ output = { error: @rescue_response }
+ output.merge! exception: @exception.inspect, backtrace: @exception.backtrace.first(10) if Rails.env.development? || Rails.env.test?
+ render json: output, status: @status_code
+ end
+end