A configurator interface for programmatically registering error pages.
Implementations of this interface are typically used to provide modular error page configuration, allowing different parts of an application or different modules to contribute their own error page definitions.
Usage Pattern
Registrars are discovered by the framework and invoked during application startup, allowing them to configure the error page registry before the application begins processing requests.
Example Implementation
@Component()
class ApiErrorRegistrar implements ErrorPageRegistrar {
@override
void configure(ErrorPageRegistry registry) {
// Register API-specific error pages
registry.addPage('/api-errors/400.json', HttpStatus.BAD_REQUEST);
registry.addPage('/api-errors/401.json', HttpStatus.UNAUTHORIZED);
registry.addPage('/api-errors/429.json', HttpStatus.TOO_MANY_REQUESTS);
}
}
Framework Integration
The framework automatically detects and invokes all ErrorPageRegistrar implementations during application initialization, allowing them to contribute to the global error page configuration.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
configure(
ErrorPageRegistry registry) → void - Configures the error page registry by adding error page definitions.
-
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