Describe the bug
ExecuteScalar fails to throw an exception when expected
To Reproduce
If you run the c# code below with the appropriate instances of connection and command created, no exception is being throw
using (var connection = .... ) { using (var command = ....) { command.CommandType = CommandType.Text; command.CommandText = $"SELECT 1 /0 As Error"; return command.ExecuteScalar(); } }
Expected behavior
"Divide by zero occurred.".
Environment
.NET Framework 4.6.2
AdoNetCore.AseClient nuget package 0.18.0
Additional context
In line 397 of InternalConnection.cs class when readerSource.TrySetException(ex) call fail we should continue
throw it up the stack
i.e
if (!readerSource.TrySetException(ex)) { throw; }
Describe the bug ExecuteScalar fails to throw an exception when expected
To Reproduce If you run the c# code below with the appropriate instances of connection and command created, no exception is being throw
using (var connection = .... ) { using (var command = ....) { command.CommandType = CommandType.Text; command.CommandText = $"SELECT 1 /0 As Error"; return command.ExecuteScalar(); } }
Expected behavior "Divide by zero occurred.".
Environment
AdoNetCore.AseClient
nuget package0.18.0
Additional context In line 397 of InternalConnection.cs class when readerSource.TrySetException(ex) call fail we should continue throw it up the stack i.e
if (!readerSource.TrySetException(ex)) { throw; }