code: public void processRequest(RequestContext context, RequestSecurityProcessorChain processorChain) throws Exception {
          try {
              processorChain.processRequest(context);
          } catch (IOException e) {
              throw e;
          } catch (Exception e) {
              SecurityProviderException se = findSecurityException(e);
              if (se != null) {
                  handleSecurityProviderException(se, context);
              } else {
                  throw e;
              }
          }
      }
docs: Catches any exception thrown by the processor chain. If the exception is an instance of a {@link
  SecurityProviderException}, the exception is handled to see if authentication is required
  ({@link AuthenticationRequiredException}), or if access to the resource is denied
  ({@link AccessDeniedException}).
  
  @param context        the context which holds the current request and response
  @param processorChain the processor chain, used to call the next processor
  @throws Exception