File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
src/DotNetElements.AppFramework/Outbox Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 22
33public interface IOutboxMessageProcessor
44{
5- Task < ResultWithError > ProcessAsync ( object message , CancellationToken cancellation ) ;
5+ Task < ResultWithError > ProcessAsync ( object message , CancellationToken cancellation ) ;
66}
77
88public abstract class OutboxMessageProcessor < T > : IOutboxMessageProcessor
99{
10- public Task < ResultWithError > ProcessAsync ( object message , CancellationToken cancellation )
11- {
12- if ( message is not T tMessage )
13- throw new ArgumentException ( "Invalid message type" ) ;
10+ public Task < ResultWithError > ProcessAsync ( object message , CancellationToken cancellation )
11+ {
12+ if ( message is not T typedMessage )
13+ throw new ArgumentException ( $ "Invalid message type: { message . GetType ( ) . Name } . Expected: { typeof ( T ) . Name } . ") ;
1414
15- return ProcessAsync ( tMessage , cancellation ) ;
16- }
15+ return ProcessAsync ( typedMessage , cancellation ) ;
16+ }
1717
18- protected abstract Task < ResultWithError > ProcessAsync ( T message , CancellationToken cancellation ) ;
18+ protected abstract Task < ResultWithError > ProcessAsync ( T message , CancellationToken cancellation ) ;
1919}
You can’t perform that action at this time.
0 commit comments