jbogard / MediatR

Simple, unambitious mediator implementation in .NET
Apache License 2.0
11.2k stars 1.18k forks source link

#1048 and v12.4.0 breaks RequestExceptionProcessorBehavior #1055

Closed luis-fss closed 1 month ago

luis-fss commented 4 months ago

The example code in https://github.com/jbogard/MediatR/wiki#exception-handler-pipeline-step

public class RequestExceptionProcessorBehavior<TRequest, TResponse, TException> : IRequestExceptionHandler<TRequest, TResponse, TException>
    where TRequest : notnull where TException : Exception
{
    public Task Handle(TRequest request, TException exception, RequestExceptionHandlerState<TResponse> state, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }
}

will throw an exception on startup:

System.ArgumentException: Error registering the generic handler type: PMCM.BlazorApp.Core.Pipeline.RequestExceptionProcessorBehavior`3. When registering generic requests with more than two type parameters, each type parameter must have at least one constraint of type interface or class.

luis-fss commented 4 months ago

Related:

1047

1048

1038

zachpainter77 commented 3 months ago

I created a PR to remove the logic that causes that error.

1057

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.