Skip to content

Commit c3d3fde

Browse files
committed
Connector. Send original connection error.
1 parent d1f1919 commit c3d3fde

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Algo/Connector_ProcessMessage.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ private void ProcessConnectMessage(BaseConnectionMessage message)
915915
SetAdapterFailed(adapter, message, ConnectionStates.Connecting, true);
916916
}
917917
else
918-
SetAdapterFailed(adapter, message, ConnectionStates.Connecting, false, new InvalidOperationException(LocalizedStrings.Str683, message.Error));
918+
SetAdapterFailed(adapter, message, ConnectionStates.Connecting, false);
919919

920920
return;
921921
}
@@ -939,7 +939,7 @@ private void ProcessConnectMessage(BaseConnectionMessage message)
939939
SetAdapterFailed(adapter, message, ConnectionStates.Disconnecting, false);
940940
}
941941
else
942-
SetAdapterFailed(adapter, message, ConnectionStates.Disconnecting, false, new InvalidOperationException(LocalizedStrings.Str684, message.Error));
942+
SetAdapterFailed(adapter, message, ConnectionStates.Disconnecting, false);
943943

944944
return;
945945
}
@@ -1088,11 +1088,11 @@ private void RaiseConnectedWhenAllConnected()
10881088
RaiseConnected();
10891089
}
10901090

1091-
private void SetAdapterFailed(IMessageAdapter adapter, BaseConnectionMessage message, ConnectionStates checkState, bool raiseTimeOut, Exception error = null)
1091+
private void SetAdapterFailed(IMessageAdapter adapter, BaseConnectionMessage message, ConnectionStates checkState, bool raiseTimeOut)
10921092
{
10931093
_adapterStates[adapter] = ConnectionStates.Failed;
10941094

1095-
error = error ?? message.Error;
1095+
var error = message.Error ?? new InvalidOperationException(message is ConnectMessage ? LocalizedStrings.Str683 : LocalizedStrings.Str684);
10961096

10971097
// raise ConnectionError only one time
10981098
if (ConnectionState == checkState)

0 commit comments

Comments
 (0)