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

play.exceptions.UnexpectedException Maven / Gradle / Ivy

The newest version!
package play.exceptions;

public class UnexpectedException extends PlayException {
    
    public UnexpectedException(String message) {
        super(message);
    }

    public UnexpectedException(Throwable exception) {
        super("Unexpected Error", exception);
    }
    
    public UnexpectedException(String message, Throwable cause) {
        super(message, cause);
    }

    @Override
    public String getErrorTitle() {
        if (getCause() == null) {
            return "Unexpected error";
        }
        return String.format("Oops: %s", getCause().getClass().getSimpleName());
    }

    @Override
    public String getErrorDescription() {
        if (getCause() != null && getCause().getClass() != null) {
            return String.format("Unexpected error : %s, caused by exception %s:
%s", getMessage(), getCause().getClass().getSimpleName(), getCause().getMessage()); } else { return String.format("Unexpected error : %s", getMessage()); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy