Package xyz.srnyx.annoyingapi.storage
Class ConnectionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
xyz.srnyx.annoyingapi.storage.ConnectionException
- All Implemented Interfaces:
Serializable
Represents an exception that occurs while attempting to connect to a database
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal @NotNull PropertiesThe properties used to connect to the database
Recommended to usegetPropertiesRedacted()for logging/other outputsfinal @NotNull StringThe URL of the database connection -
Constructor Summary
ConstructorsConstructorDescriptionConnectionException(@NotNull String message, @NotNull String url, @NotNull Properties properties) Constructs a new connection exception with the given message, URL, and propertiesConnectionException(@NotNull Throwable e, @NotNull String url, @NotNull Properties properties) Constructs a new connection exception with the given URL and properties -
Method Summary
Modifier and TypeMethodDescription@NotNull PropertiesGet the properties used to connect to the database, with the password redactedMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
url
The URL of the database connection -
properties
The properties used to connect to the database
Recommended to usegetPropertiesRedacted()for logging/other outputs
-
-
Constructor Details
-
ConnectionException
public ConnectionException(@NotNull @NotNull Throwable e, @NotNull @NotNull String url, @NotNull @NotNull Properties properties) Constructs a new connection exception with the given URL and properties- Parameters:
e- the exception that occurredurl-urlproperties-properties
-
ConnectionException
public ConnectionException(@NotNull @NotNull String message, @NotNull @NotNull String url, @NotNull @NotNull Properties properties) Constructs a new connection exception with the given message, URL, and properties- Parameters:
message- the message to displayurl-urlproperties-properties
-
-
Method Details
-
getPropertiesRedacted
Get the properties used to connect to the database, with the password redacted- Returns:
- the redacted properties
-