Module: Startback::Errors

Included in:
Startback, Operation, Services, 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



108
109
110
# File 'lib/startback/errors.rb', line 108

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

.conflict_error!(msg = nil) ⇒ Object



138
139
140
# File 'lib/startback/errors.rb', line 138

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

.expectation_failed_error!(msg = nil) ⇒ Object



158
159
160
# File 'lib/startback/errors.rb', line 158

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

.forbidden_error!(msg = nil) ⇒ Object



118
119
120
# File 'lib/startback/errors.rb', line 118

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

.gone_error!(msg = nil) ⇒ Object



143
144
145
# File 'lib/startback/errors.rb', line 143

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

.internal_server_error!(msg = nil) ⇒ Object



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

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

.locked_error!(msg = nil) ⇒ Object



163
164
165
# File 'lib/startback/errors.rb', line 163

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

.method_not_allowed_error!(msg = nil) ⇒ Object



128
129
130
# File 'lib/startback/errors.rb', line 128

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

.not_acceptable_error!(msg = nil) ⇒ Object



133
134
135
# File 'lib/startback/errors.rb', line 133

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

.not_found_error!(msg = nil) ⇒ Object



123
124
125
# File 'lib/startback/errors.rb', line 123

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

.not_implemented_error!(msg = nil) ⇒ Object



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

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

.precondition_failed_error!(msg = nil) ⇒ Object



148
149
150
# File 'lib/startback/errors.rb', line 148

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

.precondition_required_error!(msg = nil) ⇒ Object



168
169
170
# File 'lib/startback/errors.rb', line 168

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

.server_error!(msg = nil) ⇒ Object



190
191
192
# File 'lib/startback/errors.rb', line 190

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

.unauthorized_error!(msg = nil) ⇒ Object



113
114
115
# File 'lib/startback/errors.rb', line 113

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

.unsupported_media_type_error!(media) ⇒ Object



153
154
155
# File 'lib/startback/errors.rb', line 153

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

.user_error!(msg = nil) ⇒ Object

Aliases



185
186
187
# File 'lib/startback/errors.rb', line 185

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