diff --git a/src/AutoRest.CSharp/Common/Generation/Types/TypeFactory.cs b/src/AutoRest.CSharp/Common/Generation/Types/TypeFactory.cs index b9f95ba7776..1d021760ac8 100644 --- a/src/AutoRest.CSharp/Common/Generation/Types/TypeFactory.cs +++ b/src/AutoRest.CSharp/Common/Generation/Types/TypeFactory.cs @@ -89,7 +89,7 @@ public TypeFactory(OutputLibrary library, Type unknownType) }, InputDateTimeType dateTimeType => new CSharpType(typeof(DateTimeOffset), inputType.IsNullable), InputDurationType durationType => new CSharpType(typeof(TimeSpan), inputType.IsNullable), - _ => throw new Exception("Unknown type") + _ => throw new InvalidOperationException($"Unknown type: {inputType}") }; ///