Skip to content

Commit 6276e04

Browse files
author
Emile Joubert
committed
Ranamed possible authentication exception and altered message
1 parent 47b4d22 commit 6276e04

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

projects/client/RabbitMQ.Client/src/client/exceptions/ConnectionException.cs renamed to projects/client/RabbitMQ.Client/src/client/exceptions/PossibleAuthenticationFailureException.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,14 @@
5555
//
5656
//---------------------------------------------------------------------------
5757
using System;
58-
using System.Security.Authentication;
5958

6059
namespace RabbitMQ.Client.Exceptions
6160
{
6261
/// <summary> Thrown when the likely cause is an
6362
/// authentication failure. </summary>
64-
public class ConnectionException : InvalidCredentialException
63+
public class PossibleAuthenticationFailureException : Exception
6564
{
66-
public ConnectionException(String msg, Exception inner)
65+
public PossibleAuthenticationFailureException(String msg, Exception inner)
6766
: base(msg, inner)
6867
{
6968
}

projects/client/RabbitMQ.Client/src/client/impl/ConnectionBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ public void Open(bool insist)
999999
}
10001000
catch (OperationInterruptedException e)
10011001
{
1002-
throw new ConnectionException("Likely authentication failure during connection start", e);
1002+
throw new PossibleAuthenticationFailureException("Possibly caused by authentication failure", e);
10031003
}
10041004

10051005
ushort channelMax = (ushort) NegotiatedMaxValue(m_factory.RequestedChannelMax,

projects/client/Unit/src/unit/TestAuth.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ public void TestAuthFailure()
8888
{
8989
foreach (Object failureReason in bue.ConnectionErrors.Values)
9090
{
91-
Assert.IsInstanceOfType(typeof(ConnectionException), failureReason);
92-
Assert.That(((ConnectionException)failureReason).Message.ToLower().Contains("auth"));
91+
Assert.IsInstanceOfType(typeof(PossibleAuthenticationFailureException), failureReason);
92+
Assert.That(((PossibleAuthenticationFailureException)failureReason).Message.ToLower().Contains("auth"));
9393
}
9494
}
9595
}

0 commit comments

Comments
 (0)