Class: Tarantool::Client::BoxError
- Inherits:
-
Data
- Object
- Data
- Tarantool::Client::BoxError
- Defined in:
- tarantool-client/lib/tarantool/client/box_error.rb
Overview
A box.error object returned as data (MP_ERROR extension), with its cause chain.
Instance Attribute Summary collapse
-
#cause ⇒ Object
readonly
Returns the value of attribute cause.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#errno ⇒ Object
readonly
Returns the value of attribute errno.
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Attribute Details
#cause ⇒ Object (readonly)
Returns the value of attribute cause
6 7 8 |
# File 'tarantool-client/lib/tarantool/client/box_error.rb', line 6 def cause @cause end |
#code ⇒ Object (readonly)
Returns the value of attribute code
6 7 8 |
# File 'tarantool-client/lib/tarantool/client/box_error.rb', line 6 def code @code end |
#errno ⇒ Object (readonly)
Returns the value of attribute errno
6 7 8 |
# File 'tarantool-client/lib/tarantool/client/box_error.rb', line 6 def errno @errno end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields
6 7 8 |
# File 'tarantool-client/lib/tarantool/client/box_error.rb', line 6 def fields @fields end |
#file ⇒ Object (readonly)
Returns the value of attribute file
6 7 8 |
# File 'tarantool-client/lib/tarantool/client/box_error.rb', line 6 def file @file end |
#line ⇒ Object (readonly)
Returns the value of attribute line
6 7 8 |
# File 'tarantool-client/lib/tarantool/client/box_error.rb', line 6 def line @line end |
#message ⇒ Object (readonly)
Returns the value of attribute message
6 7 8 |
# File 'tarantool-client/lib/tarantool/client/box_error.rb', line 6 def @message end |
#type ⇒ Object (readonly)
Returns the value of attribute type
6 7 8 |
# File 'tarantool-client/lib/tarantool/client/box_error.rb', line 6 def type @type end |
Class Method Details
.from_stack(entries) ⇒ Object
7 8 9 10 11 12 |
# File 'tarantool-client/lib/tarantool/client/box_error.rb', line 7 def self.from_stack(entries) entries.reverse_each.reduce(nil) do |cause, entry| attributes = entry.transform_keys(Protocol::Constants::ERROR_FIELDS) new(**Protocol::Constants::ERROR_FIELDS.values.to_h { |field| [field, attributes[field]] }, cause:) end end |