mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-09 17:55:23 +00:00
Better exception
This commit is contained in:
@@ -216,6 +216,13 @@ namespace ICD.Common.Services
|
||||
try
|
||||
{
|
||||
m_ServicesSection.Enter();
|
||||
|
||||
if (m_Services.ContainsKey(tService))
|
||||
{
|
||||
string message = string.Format(string.Format("{0} already contains a {0} service", GetType().Name, tService.Name));
|
||||
throw new InvalidOperationException(message);
|
||||
}
|
||||
|
||||
m_Services.Add(tService, service);
|
||||
}
|
||||
finally
|
||||
|
||||
Reference in New Issue
Block a user