mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
Better exception
This commit is contained in:
parent
7dc074deb9
commit
72ed872872
1 changed files with 7 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue