PodDefinitionValidationException class
Exception thrown when a pod definition is invalid during validation.
This exception is useful in dependency injection containers or frameworks where pod definitions (such as configuration metadata) must meet specific requirements. If validation fails, this exception is raised to indicate what went wrong.
Example usage:
void validatePodDefinition(String name, Map<String, dynamic> definition) {
if (!definition.containsKey('type')) {
throw PodDefinitionValidationException(
'Missing required "type" property for pod: $name',
);
}
}
void main() {
try {
validatePodDefinition('myService', {});
} catch (e) {
print(e);
// Output: PodDefinitionValidationException: Missing required "type" property for pod: myService
}
}
- Inheritance
-
- Object
- NestedRuntimeException
- PodException
- PodDefinitionValidationException
- Available extensions
Constructors
- PodDefinitionValidationException(String? message, [Throwable? cause])
- Exception thrown when a pod definition is invalid during validation.
Properties
- cause → Throwable?
-
The underlying cause of this exception, if any.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- message → String?
-
The descriptive message for this exception.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTrace → StackTrace?
-
The stack trace at the point where this error was first thrown.
no setterinherited
Methods
-
contains(
Class? exType) → bool -
Checks if this exception or any exception in its cause chain is of the specified type.
inherited
-
getCause(
) → Throwable? -
The cause of this exception, if any.
inherited
-
getMessage(
) → String -
The message associated with this exception.
inherited
-
getMostSpecificCause(
) → Throwable -
Returns the most specific cause of this exception.
inherited
-
getRootCause(
) → Throwable? -
Returns the root cause of this exception by traversing the cause chain.
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
-
printStackTrace(
[bool useErrorPrint = false]) → void -
Available on Error, provided by the ErrorExtensions extension
Prints the error along with its stack trace. -
printStackTrace(
[StackTrace? stacktrace, bool useErrorPrint = false]) → void -
Available on Exception, provided by the ExceptionExtensions extension
Prints the exception and optional StackTrace if available. -
printStackTrace(
[bool useErrorPrint = false]) → void -
Available on Throwable, provided by the ThrowableExtensions extension
Extension on Throwable to support printing stack traces in a unified way. -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited