Class MagicalAuthError

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.glideidentity.exception.MagicalAuthError
All Implemented Interfaces:
Serializable

public class MagicalAuthError extends Exception
API error from Magical Auth operations.
See Also:
  • Constructor Details

    • MagicalAuthError

      public MagicalAuthError(String code, int status, String message)
      Creates an error with the specified details.
      Parameters:
      code - error code
      status - HTTP status code
      message - error message
    • MagicalAuthError

      public MagicalAuthError(Map<String,Object> response)
      Creates an error from an API response.
      Parameters:
      response - parsed error response
  • Method Details

    • getCode

      public String getCode()
    • getStatus

      public int getStatus()
    • getRequestId

      public String getRequestId()
    • setRequestId

      public void setRequestId(String requestId)
    • getDetails

      public Map<String,Object> getDetails()
    • setDetails

      public void setDetails(Map<String,Object> details)
    • is

      public boolean is(ErrorCode errorCode)
      Checks if this error matches the specified code.
      Parameters:
      errorCode - code to check
      Returns:
      true if codes match
    • isRetryable

      public boolean isRetryable()
      Indicates whether this error can be retried.
      Returns:
      true if the operation may succeed on retry
    • toString

      public String toString()
      Overrides:
      toString in class Throwable