Package org.pac4j.core.engine
Class AbstractExceptionAwareLogic
java.lang.Object
org.pac4j.core.profile.factory.ProfileManagerFactoryAware
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 Object
handleException
(Exception e, HttpActionAdapter httpActionAdapter, WebContext context) Handle exceptions.protected RuntimeException
runtimeException
(Exception exception) Wrap an Exception into a RuntimeException.void
setErrorUrl
(String errorUrl) Define on which error URL the user will be redirected in case of an exception.Methods inherited from class org.pac4j.core.profile.factory.ProfileManagerFactoryAware
getProfileManager, getProfileManagerFactory, setProfileManagerFactory
-
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
-
getErrorUrl
-
setErrorUrl
Define on which error URL the user will be redirected in case of an exception.- Parameters:
errorUrl
- the error URL
-