Search in sources :

Example 1 with ModernAppListenerException

use of lucee.runtime.listener.ModernAppListenerException in project Lucee by lucee.

the class PageContextImpl method getStatusCode.

private int getStatusCode(PageException pe) {
    int statusCode = 500;
    int maxDeepFor404 = 0;
    if (pe instanceof ModernAppListenerException) {
        pe = ((ModernAppListenerException) pe).getPageException();
        maxDeepFor404 = 1;
    } else if (pe instanceof PageExceptionBox)
        pe = ((PageExceptionBox) pe).getPageException();
    if (pe instanceof MissingIncludeException) {
        MissingIncludeException mie = (MissingIncludeException) pe;
        if (mie.getPageDeep() <= maxDeepFor404)
            statusCode = 404;
    }
    return statusCode;
}
Also used : ModernAppListenerException(lucee.runtime.listener.ModernAppListenerException) MissingIncludeException(lucee.runtime.exp.MissingIncludeException) PageExceptionBox(lucee.runtime.exp.PageExceptionBox)

Aggregations

MissingIncludeException (lucee.runtime.exp.MissingIncludeException)1 PageExceptionBox (lucee.runtime.exp.PageExceptionBox)1 ModernAppListenerException (lucee.runtime.listener.ModernAppListenerException)1