Knowledge Base Prep: Rescue DeleteRestrictionError with 422 Unprocessable Entity

This commit is contained in:
Ryan Lue 2019-03-01 05:26:53 +01:00
parent bf4e1c19c6
commit 365e8db792

View file

@ -7,6 +7,7 @@ module ApplicationController::HandlesErrors
rescue_from ActiveRecord::RecordNotFound, with: :not_found
rescue_from ActiveRecord::StatementInvalid, with: :unprocessable_entity
rescue_from ActiveRecord::RecordInvalid, with: :unprocessable_entity
rescue_from ActiveRecord::DeleteRestrictionError, with: :unprocessable_entity
rescue_from ArgumentError, with: :unprocessable_entity
rescue_from Exceptions::UnprocessableEntity, with: :unprocessable_entity
rescue_from Exceptions::NotAuthorized, with: :unauthorized