Exception: Ovh::Http2sms::PhoneNumberError

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

Overview

Raised when phone number format is invalid

Examples:

raise PhoneNumberError.new("Invalid phone number format", phone_number: "abc123")

Instance Attribute Summary collapse

Attributes inherited from Error

#raw_response, #status_code

Instance Method Summary collapse

Constructor Details

#initialize(message = "Invalid phone number", phone_number: nil, **options) ⇒ PhoneNumberError

Returns a new instance of PhoneNumberError.



108
109
110
111
# File 'lib/ovh/http2sms/errors.rb', line 108

def initialize(message = "Invalid phone number", phone_number: nil, **options)
  @phone_number = phone_number
  super(message, **options)
end

Instance Attribute Details

#phone_numberString? (readonly)

Returns The invalid phone number.

Returns:

  • (String, nil)

    The invalid phone number



106
107
108
# File 'lib/ovh/http2sms/errors.rb', line 106

def phone_number
  @phone_number
end