Skip to content

Commit 5d97fa1

Browse files
committed
Rename onException to onExceptionAsync
1 parent 213f0da commit 5d97fa1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

projects/RabbitMQ.Client/client/impl/Connection.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,18 @@ internal Connection(ConnectionConfig config, IFrameHandler frameHandler)
6464
_config = config;
6565
_frameHandler = frameHandler;
6666

67-
Func<Exception, string, Task> onException = (exception, context) => OnCallbackExceptionAsync(CallbackExceptionEventArgs.Build(exception, context));
68-
6967
_callbackExceptionAsyncWrapper =
70-
new AsyncEventingWrapper<CallbackExceptionEventArgs>(string.Empty, (exception, context) => Task.CompletedTask);
68+
new AsyncEventingWrapper<CallbackExceptionEventArgs>(string.Empty,
69+
(exception, context) => Task.CompletedTask);
7170

7271
_connectionBlockedAsyncWrapper =
73-
new AsyncEventingWrapper<ConnectionBlockedEventArgs>("OnConnectionBlocked", onException);
72+
new AsyncEventingWrapper<ConnectionBlockedEventArgs>("OnConnectionBlocked", onExceptionAsync);
7473

7574
_connectionUnblockedAsyncWrapper =
76-
new AsyncEventingWrapper<EventArgs>("OnConnectionUnblocked", onException);
75+
new AsyncEventingWrapper<EventArgs>("OnConnectionUnblocked", onExceptionAsync);
7776

7877
_connectionShutdownAsyncWrapper =
79-
new AsyncEventingWrapper<ShutdownEventArgs>("OnShutdown", onException);
78+
new AsyncEventingWrapper<ShutdownEventArgs>("OnShutdown", onExceptionAsync);
8079

8180
_sessionManager = new SessionManager(this, 0, config.MaxInboundMessageBodySize);
8281
_session0 = new MainSession(this, config.MaxInboundMessageBodySize);
@@ -89,6 +88,9 @@ internal Connection(ConnectionConfig config, IFrameHandler frameHandler)
8988
};
9089

9190
_mainLoopTask = Task.CompletedTask;
91+
92+
Task onExceptionAsync(Exception exception, string context) =>
93+
OnCallbackExceptionAsync(CallbackExceptionEventArgs.Build(exception, context));
9294
}
9395

9496
public Guid Id => _id;

0 commit comments

Comments
 (0)