mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 05:05:05 +00:00
Better exception
This commit is contained in:
@@ -216,6 +216,13 @@ namespace ICD.Common.Services
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
m_ServicesSection.Enter();
|
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);
|
m_Services.Add(tService, service);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
Reference in New Issue
Block a user