001/*
002 * Copyright © 2025 CUI-OpenSource-Software (info@cuioss.de)
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package de.cuioss.http.client.retry;
017
018import java.io.Serial;
019
020/**
021 * Exception thrown when all retry attempts for an operation have failed.
022 *
023 * This exception wraps the original exception that caused the final failure
024 * and provides context about the retry operation that was attempted.
025 */
026public class RetryException extends RuntimeException {
027
028    @Serial private static final long serialVersionUID = 1L;
029
030    /**
031     * Creates a new RetryException with the specified message.
032     *
033     * @param message the detail message
034     */
035    public RetryException(String message) {
036        super(message);
037    }
038
039    /**
040     * Creates a new RetryException with the specified message and cause.
041     *
042     * @param message the detail message
043     * @param cause the cause of the retry failure (typically the last exception encountered)
044     */
045    public RetryException(String message, Throwable cause) {
046        super(message, cause);
047    }
048
049    /**
050     * Creates a new RetryException with the specified cause.
051     *
052     * @param cause the cause of the retry failure
053     */
054    public RetryException(Throwable cause) {
055        super(cause);
056    }
057}