All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mantledillusion.metrics.trail.MetricsWrappingErrorHandler Maven / Gradle / Ivy

package com.mantledillusion.metrics.trail;

import com.vaadin.flow.server.ErrorEvent;
import com.vaadin.flow.server.ErrorHandler;

import java.util.function.Supplier;

/**
 * {@link ErrorHandler} that delegates all errors to the wrapped error handler after dispatching a
 * {@link GeneralVaadinMetrics#ERROR} metric for them.
 */
public final class MetricsWrappingErrorHandler extends AbstractMetricsWrappingErrorHandler implements ErrorHandler {

    MetricsWrappingErrorHandler(ErrorHandler wrappedErrorHandler, Supplier trailSupplier) {
        super(wrappedErrorHandler, trailSupplier);
    }

    @Override
    public void error(ErrorEvent event) {
        commit(event.getThrowable());
        getWrappedErrorHandler().error(event);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy