Exception thrown when attempting to call the next handler multiple times in a middleware pipeline.
NextHandlerAlreadyCalledException is thrown when middleware attempts to call the next handler in the pipeline more than once. This exception prevents potential issues with duplicate command processing and maintains pipeline integrity.
final class NextHandlerAlreadyCalledException extends DomainException
{
public static function create(): self;
}Creates an exception indicating the next handler has already been called.
Returns:
- Exception with message: "The next handler has already been called."
This exception serves to:
- Prevent Duplicate Processing - Ensures commands are processed only once
- Maintain Pipeline Integrity - Prevents middleware from breaking the pipeline flow
- Next - Class that implements this exception protection
- MiddlewareInterface - Interface for middleware that might throw this exception
- MiddlewarePipe - Pipeline that manages middleware execution
- CommandException - Related exception that might wrap this one