Enum Class SmsErrorCode

java.lang.Object
java.lang.Enum<SmsErrorCode>
cloud.opencode.base.sms.exception.SmsErrorCode
All Implemented Interfaces:
Serializable, Comparable<SmsErrorCode>, Constable

public enum SmsErrorCode extends Enum<SmsErrorCode>
SMS Error Code 短信错误码

Error codes for SMS operations.

短信操作的错误码。

Features | 主要功能:

  • Categorized error codes (send, phone, template, provider, content) - 分类错误码
  • Numeric code and message per error - 每个错误包含数字码和消息

Usage Examples | 使用示例:

SmsErrorCode code = SmsErrorCode.SEND_FAILED;
int numCode = code.getCode();      // 1001
String msg = code.getMessage();     // "Failed to send SMS"

Security | 安全性:

  • Thread-safe: Yes (enum is immutable) - 线程安全: 是(枚举不可变)
Since:
JDK 25, opencode-base-sms V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Enum Constant Details

    • SEND_FAILED

      public static final SmsErrorCode SEND_FAILED
    • SEND_TIMEOUT

      public static final SmsErrorCode SEND_TIMEOUT
    • SEND_RATE_LIMITED

      public static final SmsErrorCode SEND_RATE_LIMITED
    • NETWORK_ERROR

      public static final SmsErrorCode NETWORK_ERROR
    • CONNECTION_TIMEOUT

      public static final SmsErrorCode CONNECTION_TIMEOUT
    • READ_TIMEOUT

      public static final SmsErrorCode READ_TIMEOUT
    • INVALID_PHONE_NUMBER

      public static final SmsErrorCode INVALID_PHONE_NUMBER
    • PHONE_NUMBER_BLOCKED

      public static final SmsErrorCode PHONE_NUMBER_BLOCKED
    • UNSUPPORTED_COUNTRY

      public static final SmsErrorCode UNSUPPORTED_COUNTRY
    • TEMPLATE_NOT_FOUND

      public static final SmsErrorCode TEMPLATE_NOT_FOUND
    • TEMPLATE_INVALID

      public static final SmsErrorCode TEMPLATE_INVALID
    • TEMPLATE_VARIABLE_MISSING

      public static final SmsErrorCode TEMPLATE_VARIABLE_MISSING
    • PROVIDER_NOT_CONFIGURED

      public static final SmsErrorCode PROVIDER_NOT_CONFIGURED
    • PROVIDER_ERROR

      public static final SmsErrorCode PROVIDER_ERROR
    • PROVIDER_UNAVAILABLE

      public static final SmsErrorCode PROVIDER_UNAVAILABLE
    • MESSAGE_TOO_LONG

      public static final SmsErrorCode MESSAGE_TOO_LONG
    • MESSAGE_EMPTY

      public static final SmsErrorCode MESSAGE_EMPTY
    • INVALID_ENCODING

      public static final SmsErrorCode INVALID_ENCODING
  • Method Details

    • values

      public static SmsErrorCode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SmsErrorCode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getCode

      public int getCode()
    • getMessage

      public String getMessage()