Commit 1cd3efd8 authored by John M. Wright's avatar John M. Wright Committed by Nick Craver

More detailed error message on unsupported literal type (#1100)

instead of exception message of `DateTime`, you'll get `The type 'DateTime' is not supported for SQL literals.`, which is much more helpful when trying to figure out what went wrong
parent 10bfd02f
...@@ -2323,7 +2323,7 @@ public static string Format(object value) ...@@ -2323,7 +2323,7 @@ public static string Format(object value)
return sb.Append(')').__ToStringRecycle(); return sb.Append(')').__ToStringRecycle();
} }
} }
throw new NotSupportedException(value.GetType().Name); throw new NotSupportedException($"The type '{value.GetType().Name}' is not supported for SQL literals.");
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment