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

io.convergence_platform.common.exceptions.ManagedApiException Maven / Gradle / Ivy

Go to download

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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy