Module: Startback::Errors

Included in:
Startback, Operation, Web::Api, Web::CatchAll, Web::Shield
Defined in:
lib/startback/errors.rb

Defined Under Namespace

Classes: BadRequestError, ConflictError, Error, ExpectationFailedError, ForbiddenError, GoneError, InternalServerError, LockedError, MethodNotAllowedError, NotAcceptableError, NotFoundError, NotImplementedError, PreconditionFailedError, PreconditionRequiredError, UnauthorizedError, UnsupportedMediaTypeError

Class Method Summary collapse

Class Method Details

.bad_request_error!(msg = nil) ⇒ Object

Helper methods



95
96
97
# File 'lib/startback/errors.rb', line 95

def bad_request_error!(msg = nil)
  raise Startback::Errors::BadRequestError, msg
end

.conflict_error!(msg = nil) ⇒ Object



125
126
127
# File 'lib/startback/errors.rb', line 125

def conflict_error!(msg = nil)
  raise Startback::Errors::ConflictError, msg
end

.expectation_failed_error!(msg = nil) ⇒ Object



145
146
147
# File 'lib/startback/errors.rb', line 145

def expectation_failed_error!(msg = nil)
  raise Startback::Errors::ExpectationFailedError, msg
end

.forbidden_error!(msg = nil) ⇒ Object



105
106
107
# File 'lib/startback/errors.rb', line 105

def forbidden_error!(msg = nil)
  raise Startback::Errors::ForbiddenError, msg
end

.gone_error!(msg = nil) ⇒ Object



130
131
132
# File 'lib/startback/errors.rb', line 130

def gone_error!(msg = nil)
  raise Startback::Errors::GoneError, msg
end

.internal_server_error!(msg = nil) ⇒ Object



160
161
162
# File 'lib/startback/errors.rb', line 160

def internal_server_error!(msg = nil)
  raise Startback::Errors::InternalServerError, msg
end

.locked_error!(msg = nil) ⇒ Object



150
151
152
# File 'lib/startback/errors.rb', line 150

def locked_error!(msg = nil)
  raise Startback::Errors::LockedError, msg
end

.method_not_allowed_error!(msg = nil) ⇒ Object



115
116
117
# File 'lib/startback/errors.rb', line 115

def method_not_allowed_error!(msg = nil)
  raise Startback::Errors::MethodNotAllowedError, msg
end

.not_acceptable_error!(msg = nil) ⇒ Object



120
121
122
# File 'lib/startback/errors.rb', line 120

def not_acceptable_error!(msg = nil)
  raise Startback::Errors::NotAcceptableError, msg
end

.not_found_error!(msg = nil) ⇒ Object



110
111
112
# File 'lib/startback/errors.rb', line 110

def not_found_error!(msg = nil)
  raise Startback::Errors::NotFoundError, "#{msg} not found"
end

.not_implemented_error!(msg = nil) ⇒ Object



165
166
167
# File 'lib/startback/errors.rb', line 165

def not_implemented_error!(msg = nil)
  raise Startback::Errors::NotImplementedError, msg
end

.precondition_failed_error!(msg = nil) ⇒ Object



135
136
137
# File 'lib/startback/errors.rb', line 135

def precondition_failed_error!(msg = nil)
  raise Startback::Errors::PreconditionFailedError, msg
end

.precondition_required_error!(msg = nil) ⇒ Object



155
156
157
# File 'lib/startback/errors.rb', line 155

def precondition_required_error!(msg = nil)
  raise Startback::Errors::PreconditionRequiredError, msg
end

.server_error!(msg = nil) ⇒ Object



177
178
179
# File 'lib/startback/errors.rb', line 177

def server_error!(msg = nil)
  raise Startback::Errors::InternalServerError, msg
end

.unauthorized_error!(msg = nil) ⇒ Object



100
101
102
# File 'lib/startback/errors.rb', line 100

def unauthorized_error!(msg = nil)
  raise Startback::Errors::UnauthorizedError, msg
end

.unsupported_media_type_error!(media) ⇒ Object



140
141
142
# File 'lib/startback/errors.rb', line 140

def unsupported_media_type_error!(media)
  raise Startback::Errors::UnsupportedMediaTypeError, "Unable to use `#{media}` as input data"
end

.user_error!(msg = nil) ⇒ Object

Aliases



172
173
174
# File 'lib/startback/errors.rb', line 172

def user_error!(msg = nil)
  raise Startback::Errors::BadRequestError, msg
end