Exception: BrightData::SnapshotFailedError

Inherits:
Error
  • Object
show all
Defined in:
lib/brightdata/errors.rb

Overview

Raised by explicit exception-based snapshot failure flows.

‘Snapshot#wait` normally returns `SimpleResult::Failure` on failed snapshots. This class is reserved for callers who opt into exception semantics in future API versions.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, snapshot_id:, details: nil) ⇒ SnapshotFailedError

Returns a new instance of SnapshotFailedError.

Parameters:

  • message (String)

    human-readable error message

  • snapshot_id (String)

    snapshot ID

  • details (Hash, nil) (defaults to: nil)

    failure details returned by Bright Data



95
96
97
98
99
# File 'lib/brightdata/errors.rb', line 95

def initialize(message, snapshot_id:, details: nil)
  super(message)
  @snapshot_id = snapshot_id
  @details = details
end

Instance Attribute Details

#detailsHash? (readonly)

Returns failure details returned by Bright Data.

Returns:

  • (Hash, nil)

    failure details returned by Bright Data



90
91
92
# File 'lib/brightdata/errors.rb', line 90

def details
  @details
end

#snapshot_idString (readonly)

Returns snapshot ID.

Returns:

  • (String)

    snapshot ID



87
88
89
# File 'lib/brightdata/errors.rb', line 87

def snapshot_id
  @snapshot_id
end