add base API error messages

This commit is contained in:
Alex Turchyn authored and Pete Matsyburka committed 2024-01-21 15:19:16 +02:00
1 parent 0a00fe6ab8
commit f9ccca1376
4 files changed
+192

No files matched your search

@@ -15,6 +15,10 @@ module Api
before_action :authenticate_user!
check_authorization
rescue_from Params::BaseValidator::InvalidParameterError do |e|
render json: { error: e.message }, status: :unprocessable_entity
end
if Rails.env.production?
rescue_from CanCan::AccessDenied do |e|
Rollbar.error(e) if defined?(Rollbar)