io.github.eliux.mega.error.MegaException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of megacmd4j Show documentation
Show all versions of megacmd4j Show documentation
Java client library that works on top of MEGAcmd to provide access to the services of Mega.nz
package io.github.eliux.mega.error;
/**
* Defines expected errors based on behaviours of failure defined by MEGA or the library itself.
*/
public class MegaException extends RuntimeException {
public MegaException(String errorMessage) {
super(errorMessage);
}
public MegaException(String errorMessage, Object... args) {
super(String.format(errorMessage, args));
}
public MegaException(String errorMessage, Throwable errCause) {
super(errorMessage, errCause);
}
public static final MegaException nonExistingEnvVariable(String envVarName) {
return new MegaException(
"You must define the variable %s in your environment",
envVarName
);
}
}