Example usage for com.vaadin.server DefaultErrorHandler findRelevantThrowable

List of usage examples for com.vaadin.server DefaultErrorHandler findRelevantThrowable

Introduction

In this page you can find the example usage for com.vaadin.server DefaultErrorHandler findRelevantThrowable.

Prototype

public static Throwable findRelevantThrowable(Throwable t) 

Source Link

Document

Vaadin wraps exceptions in its own and due to reflection usage there might be also other irrelevant exceptions that make no sense for Vaadin users (~developers using Vaadin).

Usage

From source file:de.metas.procurement.webui.server.AbstractErrorHandler.java

License:Open Source License

@Override
public final void error(final ErrorEvent event) {
    ///*from w  w  w .  ja v  a2  s.  co m*/
    // Extract the relevant exception
    Throwable t = event.getThrowable();
    if (t instanceof SocketException) {
        // Most likely client browser closed socket
        logger.info("SocketException in CommunicationManager. Most likely client (browser) closed socket.");
        return;
    }
    t = DefaultErrorHandler.findRelevantThrowable(t);

    //
    // Create error message
    final ErrorMessage errorMessage = createErrorMessage(t);

    //
    // Display it
    displayError(errorMessage, event);

    // also print the error on console
    logger.error("", t);
}