Class YouboraErrorMapper.MappedError

java.lang.Object
com.castlabs.sdk.youbora.YouboraErrorMapper.MappedError
Enclosing interface:
YouboraErrorMapper

public static final class YouboraErrorMapper.MappedError extends Object
A Youbora error code and message, or an explicit suppression result.
Since:
5.0.1
  • Constructor Details

    • MappedError

      public MappedError(@NonNull String code, @NonNull String message)
      Creates a mapped Youbora error.
      Parameters:
      code - the error code to report.
      message - the error message to report.
      Since:
      5.0.1
  • Method Details

    • suppress

      @NonNull public static YouboraErrorMapper.MappedError suppress()
      Returns the result that explicitly suppresses reporting of the error. The returned instance is a shared sentinel; its code and message must not be accessed.
      Returns:
      the suppression result.
      Since:
      5.0.1
    • getCode

      @NonNull public String getCode()
      Returns the error code.
      Returns:
      the error code.
      Throws:
      IllegalStateException - if called on the suppression result.
      Since:
      5.0.1
    • getMessage

      @NonNull public String getMessage()
      Returns the error message.
      Returns:
      the error message.
      Throws:
      IllegalStateException - if called on the suppression result.
      Since:
      5.0.1