Exception: Playwright::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Playwright::Error
- Defined in:
- lib/playwright/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#stack ⇒ Object
readonly
Returns the value of attribute stack.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message:, name: nil, stack: nil) ⇒ Error
constructor
A new instance of Error.
- #log=(log) ⇒ Object
Constructor Details
#initialize(message:, name: nil, stack: nil) ⇒ Error
Returns a new instance of Error.
27 28 29 30 31 32 |
# File 'lib/playwright/errors.rb', line 27 def initialize(message:, name: nil, stack: nil) super() @name = name @message = @stack = stack end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
34 35 36 |
# File 'lib/playwright/errors.rb', line 34 def @message end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
34 35 36 |
# File 'lib/playwright/errors.rb', line 34 def name @name end |
#stack ⇒ Object (readonly)
Returns the value of attribute stack.
34 35 36 |
# File 'lib/playwright/errors.rb', line 34 def stack @stack end |
Class Method Details
.parse(error_payload) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/playwright/errors.rb', line 4 def self.parse(error_payload) if error_payload['name'] == 'TimeoutError' TimeoutError.new( message: error_payload['message'], stack: error_payload['stack'], ) elsif error_payload['name'] == 'TargetClosedError' TargetClosedError.new( message: error_payload['message'], stack: error_payload['stack'], ) else new( name: error_payload['name'], message: error_payload['message'], stack: error_payload['stack'], ) end end |
Instance Method Details
#log=(log) ⇒ Object
36 37 38 39 40 |
# File 'lib/playwright/errors.rb', line 36 def log=(log) return unless log format_call_log = log.join("\n - ") @message = "#{@message}\nCall log:\n#{format_call_log}\n" end |