001/* 002 * Copyright (c) 2023-2026, Agents-Flex (fuhai999@gmail.com). 003 * <p> 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 * <p> 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * <p> 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 com.agentsflex.core.util; 017 018public class RetryException extends RuntimeException { 019 /** 020 * Constructs a new runtime exception with the specified detail 021 * message, cause, suppression enabled or disabled, and writable 022 * stack trace enabled or disabled. 023 * 024 * @param message the detail message. 025 * @param cause the cause. (A {@code null} value is permitted, 026 * and indicates that the cause is nonexistent or unknown.) 027 * @param enableSuppression whether or not suppression is enabled 028 * or disabled 029 * @param writableStackTrace whether or not the stack trace should 030 * be writable 031 * @since 1.7 032 */ 033 protected RetryException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 034 super(message, cause, enableSuppression, writableStackTrace); 035 } 036 037 /** 038 * Constructs a new runtime exception with the specified cause and a 039 * detail message of <tt>(cause==null ? null : cause.toString())</tt> 040 * (which typically contains the class and detail message of 041 * <tt>cause</tt>). This constructor is useful for runtime exceptions 042 * that are little more than wrappers for other throwables. 043 * 044 * @param cause the cause (which is saved for later retrieval by the 045 * {@link #getCause()} method). (A <tt>null</tt> value is 046 * permitted, and indicates that the cause is nonexistent or 047 * unknown.) 048 * @since 1.4 049 */ 050 public RetryException(Throwable cause) { 051 super(cause); 052 } 053 054 /** 055 * Constructs a new runtime exception with the specified detail message and 056 * cause. <p>Note that the detail message associated with 057 * {@code cause} is <i>not</i> automatically incorporated in 058 * this runtime exception's detail message. 059 * 060 * @param message the detail message (which is saved for later retrieval 061 * by the {@link #getMessage()} method). 062 * @param cause the cause (which is saved for later retrieval by the 063 * {@link #getCause()} method). (A <tt>null</tt> value is 064 * permitted, and indicates that the cause is nonexistent or 065 * unknown.) 066 * @since 1.4 067 */ 068 public RetryException(String message, Throwable cause) { 069 super(message, cause); 070 } 071 072 /** 073 * Constructs a new runtime exception with the specified detail message. 074 * The cause is not initialized, and may subsequently be initialized by a 075 * call to {@link #initCause}. 076 * 077 * @param message the detail message. The detail message is saved for 078 * later retrieval by the {@link #getMessage()} method. 079 */ 080 public RetryException(String message) { 081 super(message); 082 } 083 084 /** 085 * Constructs a new runtime exception with {@code null} as its 086 * detail message. The cause is not initialized, and may subsequently be 087 * initialized by a call to {@link #initCause}. 088 */ 089 public RetryException() { 090 super(); 091 } 092}