Exception: Puppeteer::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/puppeteer/errors.rb

Overview

The base class for all Puppeteer-specific errors

Instance Attribute Summary collapse

Instance Attribute Details

#causeObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/puppeteer/errors.rb', line 7

def cause
  return nil if @cause.equal?(self)

  stack = Thread.current[:puppeteer_cause_stack] ||= []
  return nil if stack.include?(object_id)

  stack << object_id
  begin
    @cause || super
  ensure
    stack.pop
    Thread.current[:puppeteer_cause_stack] = nil if stack.empty?
  end
end