All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mercadopago.exceptions.MPApiException Maven / Gradle / Ivy

There is a newer version: 2.1.29
Show newest version
package com.mercadopago.exceptions;

import com.mercadopago.net.MPResponse;
import lombok.Getter;

/** MPApiException class. */
@Getter
public class MPApiException extends Exception {
  private final int statusCode;

  private final MPResponse apiResponse;

  /**
   * MPApiException constructor.
   *
   * @param message message
   * @param response response
   */
  public MPApiException(String message, MPResponse response) {
    this(message, null, response);
  }

  /**
   * MPApiException constructor.
   *
   * @param message message
   * @param cause cause
   * @param response response
   */
  public MPApiException(String message, Throwable cause, MPResponse response) {
    super(message, cause);
    this.apiResponse = response;
    this.statusCode = response.getStatusCode();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy