Exception: Caprese::DeleteRestrictedError

Inherits:
Error
  • Object
show all
Defined in:
lib/caprese/errors.rb

Overview

Thrown when an attempt was made to delete a record, but the record could not be deleted because of restrictions

Instance Attribute Summary

Attributes inherited from Error

#code, #field, #header, #t

Instance Method Summary collapse

Methods inherited from Error

#as_json, #full_message, #i18n_scope, #with_header

Constructor Details

#initialize(reason) ⇒ DeleteRestrictedError

Returns a new instance of DeleteRestrictedError.



80
81
82
83
# File 'lib/caprese/errors.rb', line 80

def initialize(reason)
  super code: :delete_restricted, t: { reason: reason }
  @header = { status: :forbidden }
end