Package org.pac4j.core.engine
Class AbstractExceptionAwareLogic
java.lang.Object
org.pac4j.core.engine.AbstractExceptionAwareLogic
- Direct Known Subclasses:
DefaultCallbackLogic
,DefaultLogoutLogic
,DefaultSecurityLogic
Abstract logic to handle exceptions:
- if it's a
HttpAction
, the HTTP action (which has already been performed on the web context) is "adapted" - else if an
errorUrl
is defined, the user is redirected to this error URL - otherwise the exception is thrown again
- Since:
- 3.0.0
- Author:
- Jerome Leleu
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected CallContext
buildContext
(Config config, FrameworkParameters parameters) protected Object
handleException
(Exception e, HttpActionAdapter httpActionAdapter, WebContext context) Handle exceptions.protected RuntimeException
runtimeException
(Exception exception) Wrap an Exception into a RuntimeException.
-
Constructor Details
-
AbstractExceptionAwareLogic
public AbstractExceptionAwareLogic()
-
-
Method Details
-
handleException
protected Object handleException(Exception e, HttpActionAdapter httpActionAdapter, WebContext context) Handle exceptions.- Parameters:
e
- the thrown exceptionhttpActionAdapter
- the HTTP action adaptercontext
- the web context- Returns:
- the final HTTP result
-
runtimeException
Wrap an Exception into a RuntimeException.- Parameters:
exception
- the original exception- Returns:
- the RuntimeException
-
buildContext
-