Class: XTwitterScraper::Models::Error

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/x_twitter_scraper/models/error.rb,
sig/x_twitter_scraper/models/error.rbs

Defined Under Namespace

Modules: Error

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(error:, message: nil, reason: nil, retry_after: nil, retry_after_ms: nil) ⇒ Object

Error response. Default v1 returns a legacy string error code. Send xquik-api-contract: 2026-04-29 to receive the structured best-practice error object.

Parameters:



# File 'lib/x_twitter_scraper/models/error.rb', line 39

Instance Attribute Details

#errorSymbol, ...

Parameters:

  • value (XTwitterScraper::Models::Error::error)

Returns:



13
# File 'lib/x_twitter_scraper/models/error.rb', line 13

required :error, union: -> { XTwitterScraper::Error::Error }

#messageString?

Human-readable error guidance.

Parameters:

  • (String)

Returns:

  • (String, nil)


19
# File 'lib/x_twitter_scraper/models/error.rb', line 19

optional :message, String

#reasonString?

Machine-readable reason for a login cooldown.

Parameters:

  • (String)

Returns:

  • (String, nil)


25
# File 'lib/x_twitter_scraper/models/error.rb', line 25

optional :reason, String

#retry_afterInteger?

Seconds until the next permitted request.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


31
# File 'lib/x_twitter_scraper/models/error.rb', line 31

optional :retry_after, Integer, api_name: :retryAfter

#retry_after_msInteger?

Required wait in milliseconds.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


37
# File 'lib/x_twitter_scraper/models/error.rb', line 37

optional :retry_after_ms, Integer, api_name: :retryAfterMs

Instance Method Details

#to_hash{

Returns:

  • ({)


43
# File 'sig/x_twitter_scraper/models/error.rbs', line 43

def to_hash: -> {