MissingRequiredEnvironmentException class

Exception thrown when a required environment variable is not found.

This is typically used in systems where environment variables are mandatory and their absence should fail-fast during startup or runtime.

You can optionally attach a cause for additional context.


πŸ“¦ Example Usage:

final env = Environment.SYSTEM;
try {
  final token = env.get('API_TOKEN');
} on MissingRequiredEnvironmentException catch (e) {
  print('Missing variable: ${e.message}');
}

Used internally by SystemEnvironment.get in the JetLeaf framework.

Inheritance
Implemented types

Constructors

MissingRequiredEnvironmentException(String message, {Object? cause})
Exception thrown when a required environment variable is not found.

Properties

cause β†’ Object?
The underlying cause of this exception, if any.
finalinherited
hashCode β†’ int
The hash code for this object.
no setterinherited
message β†’ String
The message describing the error.
finalinherited
runtimeType β†’ Type
A representation of the runtime type of the object.
no setterinherited
stackTrace β†’ StackTrace
The associated stack trace.
finalinherited

Methods

getCause() β†’ Object
The cause of this exception, if any.
inherited
getMessage() β†’ String
The message associated with this exception.
inherited
getStackTrace() β†’ StackTrace
The stack trace associated with this exception.
inherited
noSuchMethod(Invocation invocation) β†’ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() β†’ String
A string representation of this object.
inherited

Operators

operator ==(Object other) β†’ bool
The equality operator.
inherited