Created
September 21, 2017 13:24
-
-
Save yokolet/46639987f061c97e92764bfb0feabf55 to your computer and use it in GitHub Desktop.
app/controllers/concerns/exception_handler.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ExceptionHandler | |
extend ActiveSupport::Concern | |
included do | |
rescue_from ActiveRecord::RecordNotFound do |e| | |
render json: { message: e.message }, status: :not_found | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment