summaryrefslogtreecommitdiff
path: root/app/controllers/api/v1/errors_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/api/v1/errors_controller.rb')
-rw-r--r--app/controllers/api/v1/errors_controller.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/controllers/api/v1/errors_controller.rb b/app/controllers/api/v1/errors_controller.rb
new file mode 100644
index 0000000..b093a1f
--- /dev/null
+++ b/app/controllers/api/v1/errors_controller.rb
@@ -0,0 +1,18 @@
+module Api
+ module V1
+ class ErrorsController < ApiController
+ def create
+ failure = current_environment.failures.build(error_params)
+ failure.backtrace = params[:error][:backtrace]
+ failure.save!
+ render nothing: true
+ end
+
+ private
+
+ def error_params
+ params.require(:error).permit(:message, :hostname, :error_type, :backtrace)
+ end
+ end
+ end
+end