Exception: JSONAPI::Exceptions::RecordLocked

Inherits:
Error
  • Object
show all
Defined in:
lib/jsonapi/exceptions.rb

Instance Attribute Summary collapse

Attributes inherited from Error

#error_object_overrides

Instance Method Summary collapse

Methods inherited from Error

#create_error_object

Constructor Details

#initialize(message, error_object_overrides = {}) ⇒ RecordLocked

Returns a new instance of RecordLocked.



459
460
461
462
# File 'lib/jsonapi/exceptions.rb', line 459

def initialize(message, error_object_overrides = {})
  @message = message
  super(error_object_overrides)
end

Instance Attribute Details

#messageObject

Returns the value of attribute message.



457
458
459
# File 'lib/jsonapi/exceptions.rb', line 457

def message
  @message
end

Instance Method Details

#errorsObject



464
465
466
467
468
469
470
# File 'lib/jsonapi/exceptions.rb', line 464

def errors
  [create_error_object(code: JSONAPI::LOCKED,
                       status: :locked,
                       title: I18n.translate('jsonapi-resources.exceptions.record_locked.title',
                                             default: 'Locked resource'),
                       detail: "#{message}")]
end