Exception: StartupStats::Error
- Inherits:
-
StandardError
- Object
- StandardError
- StartupStats::Error
- Defined in:
- lib/startupstats/error.rb,
lib/startupstats/error/forbidden.rb,
lib/startupstats/error/not_found.rb,
lib/startupstats/error/bad_gateway.rb,
lib/startupstats/error/bad_request.rb,
lib/startupstats/error/client_error.rb,
lib/startupstats/error/decode_error.rb,
lib/startupstats/error/params_error.rb,
lib/startupstats/error/server_error.rb,
lib/startupstats/error/unauthorized.rb,
lib/startupstats/error/not_acceptable.rb,
lib/startupstats/error/gateway_timeout.rb,
lib/startupstats/error/internal_server_error.rb
Overview
Custom error class for rescuing from all StartupStats errors
Direct Known Subclasses
Defined Under Namespace
Classes: BadGateway, BadRequest, ClientError, DecodeError, Forbidden, GatewayTimeout, InternalServerError, NotAcceptable, NotFound, ParamsError, ServerError, Unauthorized
Instance Attribute Summary collapse
-
#wrapped_exception ⇒ Object
readonly
Returns the value of attribute wrapped_exception.
Class Method Summary collapse
Instance Method Summary collapse
- #backtrace ⇒ Object
-
#initialize(exception = $!, response_headers = {}) ⇒ StartupStats::Error
constructor
Initializes a new Error object.
Constructor Details
#initialize(exception = $!, response_headers = {}) ⇒ StartupStats::Error
Initializes a new Error object
21 22 23 24 |
# File 'lib/startupstats/error.rb', line 21 def initialize(exception=$!, response_headers={}) @wrapped_exception = exception exception.respond_to?(:backtrace) ? super(exception.) : super(exception.to_s) end |
Instance Attribute Details
#wrapped_exception ⇒ Object (readonly)
Returns the value of attribute wrapped_exception.
4 5 6 |
# File 'lib/startupstats/error.rb', line 4 def wrapped_exception @wrapped_exception end |
Class Method Details
.descendants ⇒ Array
12 13 14 |
# File 'lib/startupstats/error.rb', line 12 def self.descendants ObjectSpace.each_object(::Class).select{|klass| klass < self} end |
Instance Method Details
#backtrace ⇒ Object
26 27 28 |
# File 'lib/startupstats/error.rb', line 26 def backtrace @wrapped_exception.respond_to?(:backtrace) ? @wrapped_exception.backtrace : super end |