Skip to content

Commit

Permalink
Use plugin name in exception thrown by message sender and reciever (A…
Browse files Browse the repository at this point in the history
…zure#559)

* Update MessageReceiver.cs

* Update MessageSender.cs
  • Loading branch information
SeanFeldman authored and Håvar Nøvik committed Sep 22, 2018
1 parent f21fe0a commit 17e8cf9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Microsoft.Azure.ServiceBus/Core/MessageReceiver.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft. All rights reserved.
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Microsoft.Azure.ServiceBus.Core
Expand Down Expand Up @@ -911,7 +911,7 @@ public override void RegisterPlugin(ServiceBusPlugin serviceBusPlugin)
}
if (this.RegisteredPlugins.Any(p => p.Name == serviceBusPlugin.Name))
{
throw new ArgumentException(nameof(serviceBusPlugin), Resources.PluginAlreadyRegistered.FormatForUser(nameof(serviceBusPlugin)));
throw new ArgumentException(nameof(serviceBusPlugin), Resources.PluginAlreadyRegistered.FormatForUser(serviceBusPlugin.Name));
}
this.RegisteredPlugins.Add(serviceBusPlugin);
}
Expand Down Expand Up @@ -1690,4 +1690,4 @@ Rejected GetRejectedOutcome(IDictionary<string, object> propertiesToModify, stri
return rejected;
}
}
}
}
6 changes: 3 additions & 3 deletions src/Microsoft.Azure.ServiceBus/Core/MessageSender.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft. All rights reserved.
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Microsoft.Azure.ServiceBus.Core
Expand Down Expand Up @@ -389,7 +389,7 @@ public override void RegisterPlugin(ServiceBusPlugin serviceBusPlugin)

if (this.RegisteredPlugins.Any(p => p.GetType() == serviceBusPlugin.GetType()))
{
throw new ArgumentException(nameof(serviceBusPlugin), Resources.PluginAlreadyRegistered.FormatForUser(nameof(serviceBusPlugin)));
throw new ArgumentException(nameof(serviceBusPlugin), Resources.PluginAlreadyRegistered.FormatForUser(serviceBusPlugin.Name));
}
this.RegisteredPlugins.Add(serviceBusPlugin);
}
Expand Down Expand Up @@ -765,4 +765,4 @@ ArraySegment<byte> GetNextDeliveryTag()
return new ArraySegment<byte>(BitConverter.GetBytes(deliveryId));
}
}
}
}

0 comments on commit 17e8cf9

Please sign in to comment.