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

JavaJaxRS.resteasy.ApiException.mustache Maven / Gradle / Ivy

There is a newer version: 7.6.0
Show newest version
package {{apiPackage}};

/**
 * The exception that can be used to store the HTTP status code returned by an API response.
 */
{{>generatedAnnotation}}
public class ApiException extends Exception {
    /** The HTTP status code. */
    private int code;

    /**
     * Constructor.
     *
     * @param code The HTTP status code.
     * @param msg The error message.
     */
    public ApiException(int code, String msg) {
        super(msg);
        this.code = code;
    }

    /**
     * Get the HTTP status code.
     *
     * @return The HTTP status code.
     */
    public int getCode() {
        return code;
    }

    @Override
    public String toString() {
        return "ApiException{" +
               "code=" + code +
               '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy