Exception: InertiaRails::SSRError
- Defined in:
- lib/inertia_rails/errors.rb
Instance Attribute Summary collapse
-
#browser_api ⇒ Object
readonly
Returns the value of attribute browser_api.
-
#hint ⇒ Object
readonly
Returns the value of attribute hint.
-
#source_location ⇒ Object
readonly
Returns the value of attribute source_location.
-
#stack ⇒ Object
readonly
Returns the value of attribute stack.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message = nil, type: nil, hint: nil, browser_api: nil, stack: nil, source_location: nil) ⇒ SSRError
constructor
A new instance of SSRError.
Constructor Details
#initialize(message = nil, type: nil, hint: nil, browser_api: nil, stack: nil, source_location: nil) ⇒ SSRError
Returns a new instance of SSRError.
15 16 17 18 19 20 21 22 |
# File 'lib/inertia_rails/errors.rb', line 15 def initialize( = nil, type: nil, hint: nil, browser_api: nil, stack: nil, source_location: nil) @type = type @hint = hint @browser_api = browser_api @stack = stack @source_location = source_location super() end |
Instance Attribute Details
#browser_api ⇒ Object (readonly)
Returns the value of attribute browser_api.
13 14 15 |
# File 'lib/inertia_rails/errors.rb', line 13 def browser_api @browser_api end |
#hint ⇒ Object (readonly)
Returns the value of attribute hint.
13 14 15 |
# File 'lib/inertia_rails/errors.rb', line 13 def hint @hint end |
#source_location ⇒ Object (readonly)
Returns the value of attribute source_location.
13 14 15 |
# File 'lib/inertia_rails/errors.rb', line 13 def source_location @source_location end |
#stack ⇒ Object (readonly)
Returns the value of attribute stack.
13 14 15 |
# File 'lib/inertia_rails/errors.rb', line 13 def stack @stack end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
13 14 15 |
# File 'lib/inertia_rails/errors.rb', line 13 def type @type end |
Class Method Details
.from_exception(exception) ⇒ Object
35 36 37 38 39 |
# File 'lib/inertia_rails/errors.rb', line 35 def self.from_exception(exception) error = new(exception., type: 'connection') error.set_backtrace(exception.backtrace) error end |
.from_response(body) ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/inertia_rails/errors.rb', line 24 def self.from_response(body) new( body['error'] || 'Unknown SSR error', type: body['type'], hint: body['hint'], browser_api: body['browserApi'], stack: body['stack'], source_location: body['sourceLocation'] ) end |