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

org.rajivprab.sava.rest.IllegalUserInputException Maven / Gradle / Ivy

package org.rajivprab.sava.rest;

import org.rajivprab.sava.logging.LogDispatcher.Severity;

import javax.ws.rs.core.Response.Status;

/**
 * Extension of DispatchWebAppException, customized for illegal-user-inputs
 *
 * Created by rajivprab on 6/5/17.
 */
public class IllegalUserInputException extends DispatchWebAppException {
    private static final String ERROR_PREPEND = "Sorry, your user input is illegal: ";

    public IllegalUserInputException(String messageAppend) {
        this(messageAppend, null);
    }

    public IllegalUserInputException(String messageAppend, Throwable cause) {
        this(messageAppend, Severity.WARN, cause);
    }

    public IllegalUserInputException(String messageAppend, Severity severity, Throwable cause) {
        super(ERROR_PREPEND + messageAppend, severity, cause, Status.BAD_REQUEST);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy