Class: Herb::Errors::TimeoutError
- Includes:
- Colors
- Defined in:
- lib/herb/errors.rb,
sig/herb/errors.rbs,
ext/herb/error_helpers.c
Constant Summary
Constants included from Colors
Colors::CLEAR_SCREEN, Colors::HIDE_CURSOR, Colors::SHOW_CURSOR
Instance Attribute Summary collapse
-
#timeout_ms ⇒ Integer?
readonly
| timeout_ms: Integer?, | }.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(type, location, message, timeout_ms) ⇒ TimeoutError
constructor
: (String, Location?, String, Integer) -> void.
-
#inspect ⇒ String
: () -> String.
-
#to_hash ⇒ serialized_timeout_error
: () -> serialized_timeout_error.
-
#tree_inspect(indent: 0, depth: 0, depth_limit: 25) ⇒ String
: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String.
Methods included from Colors
bold, bright_magenta, cyan, dimmed, enabled?, fg, fg_bg, green, magenta, red, #self?.bold, #self?.bright_magenta, #self?.cyan, #self?.dimmed, #self?.enabled?, #self?.fg, #self?.fg_bg, #self?.green, #self?.magenta, #self?.red, #self?.white, #self?.yellow, white, yellow
Methods inherited from Error
#class_name, #error_name, #to_json
Constructor Details
#initialize(type, location, message, timeout_ms) ⇒ TimeoutError
: (String, Location?, String, Integer) -> void
1538 1539 1540 1541 |
# File 'lib/herb/errors.rb', line 1538 def initialize(type, location, , timeout_ms) super(type, location, ) @timeout_ms = timeout_ms end |
Instance Attribute Details
#timeout_ms ⇒ Integer? (readonly)
| timeout_ms: Integer?, | }
1535 1536 1537 |
# File 'lib/herb/errors.rb', line 1535 def timeout_ms @timeout_ms end |
Instance Method Details
#inspect ⇒ String
: () -> String
1544 1545 1546 |
# File 'lib/herb/errors.rb', line 1544 def inspect tree_inspect.rstrip.gsub(/\s+$/, "") end |
#to_hash ⇒ serialized_timeout_error
: () -> serialized_timeout_error
1549 1550 1551 1552 1553 |
# File 'lib/herb/errors.rb', line 1549 def to_hash super.merge( timeout_ms: timeout_ms ) #: Herb::serialized_timeout_error end |
#tree_inspect(indent: 0, depth: 0, depth_limit: 25) ⇒ String
: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 |
# File 'lib/herb/errors.rb', line 1556 def tree_inspect(indent: 0, depth: 0, depth_limit: 25) output = +"" output += white("@ #{bold(red(error_name))} #{dimmed("(location: #{location&.tree_inspect})\n")}") output += white("├── message: #{green(.inspect)}\n") output += white("└── timeout_ms: #{green(timeout_ms.inspect)}\n") output += %(\n) output.gsub(/^/, " " * indent) end |