Exception: Browserctl::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Browserctl::Error
- Defined in:
- lib/browserctl/errors.rb
Overview
Base error class for all browserctl daemon errors. Subclasses carry a machine-readable ‘code` that appears in wire responses.
Direct Known Subclasses
DomainNotAllowed, KeyNotFound, PageNotFound, PathNotAllowed, RefNotFound, SelectorNotFound, TimeoutError
Instance Attribute Summary collapse
-
#code ⇒ String
readonly
machine-readable error code.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(msg = nil, code: self.class.default_code) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(msg = nil, code: self.class.default_code) ⇒ Error
Returns a new instance of Error.
12 13 14 15 |
# File 'lib/browserctl/errors.rb', line 12 def initialize(msg = nil, code: self.class.default_code) @code = code super(msg) end |
Instance Attribute Details
#code ⇒ String (readonly)
machine-readable error code
7 8 9 |
# File 'lib/browserctl/errors.rb', line 7 def code @code end |
Class Method Details
.default_code ⇒ Object
8 |
# File 'lib/browserctl/errors.rb', line 8 def self.default_code = "error" |