1 /*
2 * Copyright (c) 2023. Roland T. Lichti, Kaiserpfalz EDV-Service.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18 /*
19 * Libravatar -- Java Library for retrieving libravatars.
20 *
21 * The code in this package is taken from {@linkplain https://github.com/alessandroleite/libravatar-j}.
22 *
23 * It is licensed under a MIT license by Alessandro Leite.
24 */
25 package de.kaiserpfalzedv.commons.api.libravatar;
26
27
28 import de.kaiserpfalzedv.commons.api.BaseSystemException;
29 import lombok.Getter;
30
31 import java.io.Serial;
32
33 /**
34 * The class of all Libravatar related exceptions.
35 *
36 * @author alessandroleite {@literal @github}
37 * @author klenkes74 {@literal <rlichti@kaiserpfalz-edv.de>}
38 * @since 2.3.0 2022-12-28
39 */
40 @Getter
41 public class AvatarException extends BaseSystemException {
42 /**
43 * Serial code version <code>serialVersionUID</code>
44 */
45 @Serial
46 private static final long serialVersionUID = 2574665849051070802L;
47
48 /**
49 * Constructs a new exception with the specified detail message.
50 *
51 * The cause is not initialized, and may subsequently be initialized by
52 * a call to {@link #initCause}.
53 *
54 * @param message the detail message. The detail message is saved for
55 * later retrieval by the {@link #getMessage()} method.
56 * @since 2.3.0 2022-12-28
57 */
58 public AvatarException(String message) {
59 super(message);
60 }
61
62 /**
63 * Constructs a new exception with the specified cause and a detail
64 * message of {@code (cause==null ? null : cause.toString())} (which
65 * typically contains the class and detail message of {@code cause}).
66 * This constructor is useful for exceptions that are little more than
67 * wrappers for other throwables (for example, {@link java.security.PrivilegedActionException}).
68 *
69 * @param cause the cause (which is saved for later retrieval by the
70 * {@link #getCause()} method). (A {@code null} value is
71 * permitted, and indicates that the cause is nonexistent or
72 * unknown.)
73 * @since 2.3.0 2022-12-28
74 */
75 public AvatarException(final Throwable cause) {
76 super(cause);
77 }
78
79 /**
80 * Constructs a new exception with the specified detail message and
81 * cause.
82 * <p>Note that the detail message associated with
83 * {@code cause} is <i>not</i> automatically incorporated in
84 * this exception's detail message.
85 *
86 * @param message the detail message (which is saved for later retrieval
87 * by the {@link #getMessage()} method).
88 * @param cause the cause (which is saved for later retrieval by the
89 * {@link #getCause()} method). (A {@code null} value is
90 * permitted, and indicates that the cause is nonexistent or
91 * unknown.)
92 * @since 2.3.0 2022-12-28
93 */
94 public AvatarException(final String message, final Throwable cause) {
95 super(message, cause);
96 }
97
98
99 /**
100 * Constructs a new exception with the specified detail message, cause, suppression enabled or disabled, and
101 * writable stack trace enabled or disabled.
102 *
103 * @param message the detail message.
104 * @param cause the cause. (A {@code null} value is permitted,
105 * and indicates that the cause is nonexistent or unknown.)
106 * @param enableSuppression whether or not suppression is enabled
107 * or disabled
108 * @param writableStackTrace whether or not the stack trace should
109 * be writable
110 * @since 2.3.0 2022-12-28
111 */
112 public AvatarException(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) {
113 super(message, cause, enableSuppression, writableStackTrace);
114 }
115 }