Exception: Dcmgr::Endpoints::APIError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/dcmgr/endpoints/errors.rb

Direct Known Subclasses

DeprecatedAPIError

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.error_code(code = nil) ⇒ Object

Internal error code of the error.



47
48
49
50
51
52
# File 'lib/dcmgr/endpoints/errors.rb', line 47

def self.error_code(code=nil)
  if code
    @error_code = code
  end
  @error_code || raise("@error_code for the class is not set")
end

.status_code(code = nil) ⇒ Object

HTTP status code of the error.



39
40
41
42
43
44
# File 'lib/dcmgr/endpoints/errors.rb', line 39

def self.status_code(code=nil)
  if code
    @status_code = code
  end
  @status_code || raise("@status_code for the class is not set")
end

Instance Method Details

#error_codeObject



58
59
60
# File 'lib/dcmgr/endpoints/errors.rb', line 58

def error_code
  self.class.error_code
end

#status_codeObject



54
55
56
# File 'lib/dcmgr/endpoints/errors.rb', line 54

def status_code
  self.class.status_code
end