diff --git a/Packages/se.hertzole.scriptable-values/Runtime/Values/ValueReference.cs b/Packages/se.hertzole.scriptable-values/Runtime/Values/ValueReference.cs index a1be25c..6bba0f8 100644 --- a/Packages/se.hertzole.scriptable-values/Runtime/Values/ValueReference.cs +++ b/Packages/se.hertzole.scriptable-values/Runtime/Values/ValueReference.cs @@ -177,7 +177,7 @@ private T GetValue() $"Addressable asset is not loaded yet. Make sure you've called {nameof(LoadAddressableAssetAsync)} before trying to access the value."); #endif default: - throw new ArgumentOutOfRangeException(nameof(valueType), $"No supported value type for {valueType}."); + throw new NotSupportedException($"No supported value type for {valueType}."); } } @@ -202,6 +202,8 @@ private void SetValue(in T value, in bool notify) SetValueAddressable(value, notify); break; #endif + default: + throw new NotSupportedException($"No supported value type for {valueType}."); } } diff --git a/Packages/se.hertzole.scriptable-values/Tests/Runtime/BaseValueReferenceTest.cs b/Packages/se.hertzole.scriptable-values/Tests/Runtime/BaseValueReferenceTest.cs index c1cf7a8..ee366a9 100644 --- a/Packages/se.hertzole.scriptable-values/Tests/Runtime/BaseValueReferenceTest.cs +++ b/Packages/se.hertzole.scriptable-values/Tests/Runtime/BaseValueReferenceTest.cs @@ -226,7 +226,7 @@ public void InvalidType_Get() { TValue temp = instance.Value; } - catch (ArgumentOutOfRangeException) + catch (NotSupportedException) { gotError = true; } @@ -247,7 +247,7 @@ public void InvalidType_Set() { instance.Value = MakeDifferentValue(default); } - catch (ArgumentOutOfRangeException) + catch (NotSupportedException) { gotError = true; }