Package me.kzlyth.api.exceptions
Klasse APIUnavailableException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
me.kzlyth.api.exceptions.ZenithAPIException
me.kzlyth.api.exceptions.APIUnavailableException
- Alle implementierten Schnittstellen:
Serializable
Exception thrown when the API is not available or the plugin is not enabled.
This exception is typically thrown when attempting to access the API before the plugin has fully loaded or after it has been disabled.
Example:
ZenithAPI api = ZenithAPI.getInstance();
if (api == null) {
throw new APIUnavailableException("Zenith-Mod is not loaded");
}
if (!api.isAvailable()) {
throw new APIUnavailableException("Zenith-Mod is disabled");
}
- Seit:
- 1.2.3
- Autor:
- Zenith-Studios
- Siehe auch:
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungConstructs a new APIUnavailableException with a default message.APIUnavailableException(@Nullable String message) Constructs a new APIUnavailableException with the specified detail message.APIUnavailableException(@Nullable String message, @Nullable Throwable cause) Constructs a new APIUnavailableException with the specified detail message and cause. -
Methodenübersicht
Von Klasse geerbte Methoden java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Konstruktordetails
-
APIUnavailableException
public APIUnavailableException()Constructs a new APIUnavailableException with a default message.Example:
if (!api.isAvailable()) { throw new APIUnavailableException(); } -
APIUnavailableException
Constructs a new APIUnavailableException with the specified detail message.Example:
throw new APIUnavailableException("Zenith-Mod plugin was disabled");- Parameter:
message- The detail message
-
APIUnavailableException
public APIUnavailableException(@Nullable @Nullable String message, @Nullable @Nullable Throwable cause) Constructs a new APIUnavailableException with the specified detail message and cause.Example:
try { // Try to access API } catch (Exception e) { throw new APIUnavailableException("API failed to initialize", e); }- Parameter:
message- The detail messagecause- The cause of this exception
-