Exception: MotherBrain::APIError

Inherits:
MBError
  • Object
show all
Defined in:
lib/mb/errors.rb

Direct Known Subclasses

ApplicationPaused

Constant Summary collapse

DEFAULT_HTTP_STATUS_CODE =
500

Constants inherited from MBError

MBError::DEFAULT_EXIT_CODE

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from MBError

#error_code, error_code, exit_code, #exit_code, #initialize, #message, #to_hash, #to_json, #to_s

Constructor Details

This class inherits a constructor from MotherBrain::MBError

Class Method Details

.http_status_code(code = DEFAULT_HTTP_STATUS_CODE) ⇒ Integer

Parameters:

  • code (Integer) (defaults to: DEFAULT_HTTP_STATUS_CODE)

Returns:

  • (Integer)


99
100
101
# File 'lib/mb/errors.rb', line 99

def http_status_code(code = DEFAULT_HTTP_STATUS_CODE)
  @exit_code ||= code
end

Instance Method Details

#http_status_codeObject



104
105
106
# File 'lib/mb/errors.rb', line 104

def http_status_code
  self.class.http_status_code
end