FIX: show invite validation error message in response

This commit is contained in:
Arpit Jalan
2017-06-13 22:29:02 +05:30
parent 009f0921dc
commit 34996b4eff
2 changed files with 11 additions and 1 deletions

View File

@ -76,7 +76,7 @@ class InvitesController < ApplicationController
else
render json: failed_json, status: 422
end
rescue Invite::UserExists => e
rescue Invite::UserExists, ActiveRecord::RecordInvalid => e
render json: {errors: [e.message]}, status: 422
end
end