Skip to content
Permalink
Browse files

Type of exception thrown by Singleton<T>.SetSingletonInstance(T) chan…

…ged from ArgumentException to InvalidOperationException
  • Loading branch information...
jlahteen committed Sep 29, 2019
1 parent f7ab7d6 commit b833a649b5a2bb1631381ec3ea977d537ba8747e
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Juhta.Net/Common/Singleton.cs
@@ -1,6 +1,6 @@

//
// Juhta.NET, Copyright (c) 2017 Juha Lähteenmäki
// Juhta.NET, Copyright (c) 2017-2019 Juha Lähteenmäki
//
// This source code may be used, modified and distributed under the terms of
// the MIT license. Please refer to the LICENSE.txt file for details.
@@ -69,7 +69,7 @@ protected void SetSingletonInstance(T instance)
lock(s_syncLock)
{
if (s_instance != null)
throw new ArgumentException(CommonMessages.Error014.FormatMessage(typeof(T).FullName));
throw new InvalidOperationException(CommonMessages.Error014.FormatMessage(typeof(T).FullName));

s_instance = instance;
}

0 comments on commit b833a64

Please sign in to comment.
You can’t perform that action at this time.