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, TooManyRequestsError, UnauthorizedError, UnsupportedMediaTypeError
Class Method Summary collapse
-
.bad_request_error!(msg = nil) ⇒ Object
Helper methods.
- .conflict_error!(msg = nil) ⇒ Object
- .expectation_failed_error!(msg = nil) ⇒ Object
- .forbidden_error!(msg = nil) ⇒ Object
- .gone_error!(msg = nil) ⇒ Object
- .internal_server_error!(msg = nil) ⇒ Object
- .locked_error!(msg = nil) ⇒ Object
- .method_not_allowed_error!(msg = nil) ⇒ Object
- .not_acceptable_error!(msg = nil) ⇒ Object
- .not_found_error!(msg = nil) ⇒ Object
- .not_implemented_error!(msg = nil) ⇒ Object
- .precondition_failed_error!(msg = nil) ⇒ Object
- .precondition_required_error!(msg = nil) ⇒ Object
- .server_error!(msg = nil) ⇒ Object
- .unauthorized_error!(msg = nil) ⇒ Object
- .unsupported_media_type_error!(media) ⇒ Object
-
.user_error!(msg = nil) ⇒ Object
Aliases.
Class Method Details
.bad_request_error!(msg = nil) ⇒ Object
Helper methods
112 113 114 |
# File 'lib/startback/errors.rb', line 112 def bad_request_error!(msg = nil) raise Startback::Errors::BadRequestError, msg end |
.conflict_error!(msg = nil) ⇒ Object
142 143 144 |
# File 'lib/startback/errors.rb', line 142 def conflict_error!(msg = nil) raise Startback::Errors::ConflictError, msg end |
.expectation_failed_error!(msg = nil) ⇒ Object
162 163 164 |
# File 'lib/startback/errors.rb', line 162 def expectation_failed_error!(msg = nil) raise Startback::Errors::ExpectationFailedError, msg end |
.forbidden_error!(msg = nil) ⇒ Object
122 123 124 |
# File 'lib/startback/errors.rb', line 122 def forbidden_error!(msg = nil) raise Startback::Errors::ForbiddenError, msg end |
.gone_error!(msg = nil) ⇒ Object
147 148 149 |
# File 'lib/startback/errors.rb', line 147 def gone_error!(msg = nil) raise Startback::Errors::GoneError, msg end |
.internal_server_error!(msg = nil) ⇒ Object
177 178 179 |
# File 'lib/startback/errors.rb', line 177 def internal_server_error!(msg = nil) raise Startback::Errors::InternalServerError, msg end |
.locked_error!(msg = nil) ⇒ Object
167 168 169 |
# File 'lib/startback/errors.rb', line 167 def locked_error!(msg = nil) raise Startback::Errors::LockedError, msg end |
.method_not_allowed_error!(msg = nil) ⇒ Object
132 133 134 |
# File 'lib/startback/errors.rb', line 132 def method_not_allowed_error!(msg = nil) raise Startback::Errors::MethodNotAllowedError, msg end |
.not_acceptable_error!(msg = nil) ⇒ Object
137 138 139 |
# File 'lib/startback/errors.rb', line 137 def not_acceptable_error!(msg = nil) raise Startback::Errors::NotAcceptableError, msg end |
.not_found_error!(msg = nil) ⇒ Object
127 128 129 |
# File 'lib/startback/errors.rb', line 127 def not_found_error!(msg = nil) raise Startback::Errors::NotFoundError, "#{msg} not found" end |
.not_implemented_error!(msg = nil) ⇒ Object
182 183 184 |
# File 'lib/startback/errors.rb', line 182 def not_implemented_error!(msg = nil) raise Startback::Errors::NotImplementedError, msg end |
.precondition_failed_error!(msg = nil) ⇒ Object
152 153 154 |
# File 'lib/startback/errors.rb', line 152 def precondition_failed_error!(msg = nil) raise Startback::Errors::PreconditionFailedError, msg end |
.precondition_required_error!(msg = nil) ⇒ Object
172 173 174 |
# File 'lib/startback/errors.rb', line 172 def precondition_required_error!(msg = nil) raise Startback::Errors::PreconditionRequiredError, msg end |
.server_error!(msg = nil) ⇒ Object
194 195 196 |
# File 'lib/startback/errors.rb', line 194 def server_error!(msg = nil) raise Startback::Errors::InternalServerError, msg end |
.unauthorized_error!(msg = nil) ⇒ Object
117 118 119 |
# File 'lib/startback/errors.rb', line 117 def (msg = nil) raise Startback::Errors::UnauthorizedError, msg end |
.unsupported_media_type_error!(media) ⇒ Object
157 158 159 |
# File 'lib/startback/errors.rb', line 157 def unsupported_media_type_error!(media) raise Startback::Errors::UnsupportedMediaTypeError, "Unable to use `#{media}` as input data" end |
.user_error!(msg = nil) ⇒ Object
Aliases
189 190 191 |
# File 'lib/startback/errors.rb', line 189 def user_error!(msg = nil) raise Startback::Errors::BadRequestError, msg end |