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

com.mindee.http.MindeeHttpException Maven / Gradle / Ivy

The newest version!
package com.mindee.http;

import com.mindee.MindeeException;
import lombok.Getter;

/**
 * Represent a Mindee exception.
 */
@Getter
public class MindeeHttpException extends MindeeException {
  /** Standard HTTP status code. */
  private final int statusCode;
  /** Error details. */
  private final String details;
  /** Error code (not HTTP code). */
  private final String code;

  public MindeeHttpException(int statusCode, String message, String details, String code) {
    super(message);
    this.statusCode = statusCode;
    this.details = details;
    this.code = code;
  }

  public String toString() {
    String outStr = super.toString() + " - HTTP " + getStatusCode();
    if (!getDetails().isEmpty()) {
      outStr += " - " + getDetails();
    }
    return outStr;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy