com.mindee.http.MindeeHttpException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mindee-api-java Show documentation
Show all versions of mindee-api-java Show documentation
Java Library to call Mindee's Off-The-Shelf and Custom APIs
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;
}
}