001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the License.
004 *
005 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
006 * specific language governing permission and limitations under the License.
007 *
008 * When distributing Covered Software, include this CDDL Header Notice in each file and include
009 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
010 * Header, with the fields enclosed by brackets [] replaced by your own identifying
011 * information: "Portions copyright [year] [name of copyright owner]".
012 *
013 * Copyright 2015 ForgeRock AS.
014 */
015package org.forgerock.util.promise;
016
017/**
018 * A completion handler for consuming exceptions which occur during the execution of
019 * asynchronous tasks.
020 *
021 * @param <E>
022 *            The type of exception consumed by the handler.
023 */
024// @FunctionalInterface
025public interface ExceptionHandler<E> {
026    /**
027     * Invoked when the asynchronous task has failed.
028     *
029     * @param exception
030     *            The exception indicating why the asynchronous task has failed.
031     */
032    void handleException(E exception);
033}