Example usage for org.springframework.security.web.util ThrowableAnalyzer verifyThrowableHierarchy

List of usage examples for org.springframework.security.web.util ThrowableAnalyzer verifyThrowableHierarchy

Introduction

In this page you can find the example usage for org.springframework.security.web.util ThrowableAnalyzer verifyThrowableHierarchy.

Prototype

public static void verifyThrowableHierarchy(Throwable throwable, Class<? extends Throwable> expectedBaseType) 

Source Link

Document

Verifies that the provided throwable is a valid subclass of the provided type (or of the type itself).

Usage

From source file:grails.plugin.springsecurity.web.access.DefaultThrowableAnalyzer.java

@Override
protected void initExtractorMap() {
    super.initExtractorMap();

    registerExtractor(ServletException.class, new ThrowableCauseExtractor() {
        public Throwable extractCause(Throwable throwable) {
            ThrowableAnalyzer.verifyThrowableHierarchy(throwable, ServletException.class);
            return ((ServletException) throwable).getRootCause();
        }//from ww  w .ja  va  2  s  .co m
    });
}