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

play.exceptions.ActionNotFoundException Maven / Gradle / Ivy

There is a newer version: 1.5.0
Show newest version
package play.exceptions;

/**
 * Missing action
 */
public class ActionNotFoundException extends PlayException {

    private String action;
   
    public ActionNotFoundException(String action, Throwable cause) {
        super(String.format("Action %s not found", action.startsWith("controllers.") ? action.substring(12) : action), cause);
        this.action = action.startsWith("controllers.") ? action.substring(12) : action;
    }

    public String getAction() {
        return action;
    }

    @Override
    public String getErrorTitle() {
        return String.format("Action not found");
    }

    @Override
    public String getErrorDescription() {
        return String.format(
                "Action %s could not be found. Error raised is %s", 
                action, 
                getCause() instanceof ClassNotFoundException ? "ClassNotFound: "+getCause().getMessage() : getCause().getMessage()
        );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy