MissingRequiredPropertiesException class final
The error for properties that were declared required and have no value.
Startup code declares keys the application cannot run without with
setRequiredProperties; validateRequiredProperties then throws this,
listing all missing keys at once, so an operator sees everything to fix
in one go. An application context validates when it starts, so the
start fails before any bean is created. Applications receive it as a
startup failure; they rarely catch it.
environment
..setRequiredProperties(['db.url', 'db.user'])
..validateRequiredProperties(); // throws if one is missing
Spring (Java):
environment.setRequiredProperties("db.url", "db.user");
environment.validateRequiredProperties();
- Implemented types
Constructors
-
MissingRequiredPropertiesException(Iterable<
String> missing) -
Creates the exception listing the
missingkeys.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
missingRequiredProperties
→ List<
String> -
The required keys that have no value, in the order they were
declared.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited