Exception: Smspilot::Error::ApiError
- Inherits:
-
StandardError
- Object
- StandardError
- Smspilot::Error::ApiError
show all
- Defined in:
- lib/smspilot/errors.rb
Direct Known Subclasses
ApiKeyBlocked, ApiKeyInvalid, ApiKeyRequired, FromDeprecatedError, FromInvalidError, IdInvalidError, InputDataRequiredError, InputListInvalidError, InvalidJsonError, InvalidSmsCheckListError, IpRestrictionError, NotEnoughCreditsError, PacketIdInvalidError, ServerIdInvalidError, ServerIdNotFoundError, ServerIdRequiredError, ServerPacketIdInvalidError, SmsCountLimitError, SystemError, TextRequiredError, TextTooLongError, ToDeprecatedError, ToInvalidError, ToRequiredError, UnknownApiError, UnknownCommandError, UnknownInputFormatError, UnsupportedZoneError, UserNotFoundError
Class Method Summary
collapse
Class Method Details
.get_by_code(code = nil) ⇒ Object
45
46
47
48
49
50
51
|
# File 'lib/smspilot/errors.rb', line 45
def self.get_by_code(code=nil)
if API_ERROR_CODES[code].nil?
UnknownApiError
else
Smspilot::Error.const_get(API_ERROR_CODES[code])
end
end
|
.raise_by_code(code = nil) ⇒ Object
37
38
39
40
41
42
43
|
# File 'lib/smspilot/errors.rb', line 37
def self.raise_by_code(code=nil)
if API_ERROR_CODES[code].nil?
raise UnknownApiError
else
raise Smspilot::Error.const_get(API_ERROR_CODES[code])
end
end
|