diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index e3ac9fc67e..c550b38e8e 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -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