Class ApiExceptionBuilder

java.lang.Object
com.sinch.sdk.core.exceptions.ApiExceptionBuilder

public class ApiExceptionBuilder extends Object
APIException Builder helper to transform dedicated domains error response to Exception
  • Method Details

    • build

      public static ApiException build(String message, int code, Map<String,?> mappedResponse)
      Consume Unqualified Map of fields received from an API error into a dedicated Exception
      Parameters:
      message - the detail message.
      code - Code
      mappedResponse - Map of fields (usually coming from a JSON representation) to be interpreted
      Returns:
      Dedicated ApiException