Skip to content
Snippets Groups Projects
Commit 96ad9b0d authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Meaningful validation errors in API response

parent 62b057b0
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,8 @@ class ApiController < ApplicationController
protect_from_forgery with: :null_session
skip_before_action :verify_authenticity_token
rescue_from ActiveRecord::RecordInvalid do
render json: { error: 'Record invalid' }, status: 422
rescue_from ActiveRecord::RecordInvalid do |e|
render json: { error: e.to_s }, status: 422
end
rescue_from ActiveRecord::RecordNotFound do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment