io.convergence_platform.common.exceptions.ManagedApiException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of service-lib Show documentation
Show all versions of service-lib Show documentation
Holds the common functionality needed by all Convergence Platform-based services written in Java.
The newest version!
package io.convergence_platform.common.exceptions;
import io.convergence_platform.common.responses.IApiResponseBody;
public class ManagedApiException extends RuntimeException {
private final String code;
private final String message;
private final IApiResponseBody errorDetails;
private int httpStatusCode = 500;
public ManagedApiException(int statusCode, String code, String message) {
this.code = code;
httpStatusCode = statusCode;
this.message = message;
errorDetails = null;
}
public ManagedApiException(int statusCode, String code, String message, IApiResponseBody errorDetails) {
this.code = code;
httpStatusCode = statusCode;
this.message = message;
this.errorDetails = errorDetails;
}
public String getCode() {
return code;
}
@Override
public String getMessage() {
return message;
}
public int getHttpStatusCode() {
return httpStatusCode;
}
public IApiResponseBody getErrorDetails() {
return errorDetails;
}
}