FIX: rescue specific errors on invite failure

This commit is contained in:
Arpit Jalan
2017-05-02 15:13:33 +05:30
parent f5b11cb429
commit 77a8cae094
6 changed files with 9 additions and 7 deletions

View File

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