Class EnvContextLoaderException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.sysr.springcontext.env.exception.EnvContextLoaderException
- All Implemented Interfaces:
Serializable
Exception thrown when there is an error loading the environment variables
from a dotenv file in a Spring application. This exception extends
RuntimeException, indicating it is a unchecked exception that can
occur during the normal operation of the application, particularly during
environment setup or context loading.
Using this exception helps to pinpoint issues related to the application context not being properly configured due to missing or misconfigured environment variables.
Example usage:
try {
// Some code
} catch (IOException e) {
throw new EnvContextLoaderException("Failed to load environment variables", e);
}
- Since:
- 2024
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEnvContextLoaderException(String message) Constructs a new EnvContextLoaderException with the specified detail message.EnvContextLoaderException(String message, Throwable cause) Constructs a new EnvContextLoaderException with the specified detail message and cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
EnvContextLoaderException
Constructs a new EnvContextLoaderException with the specified detail message.- Parameters:
message- the detail message, saved for later retrieval by theThrowable.getMessage()method.
-
EnvContextLoaderException
Constructs a new EnvContextLoaderException with the specified detail message and cause.- Parameters:
message- the detail message explaining the reason for the exception, saved for later retrieval by theThrowable.getMessage()method.cause- the underlying cause of the exception, saved for later retrieval by theThrowable.getCause()method.
-