Skip to content

Commit a37b695

Browse files
committed
Simplify exception handling.
This could theoretically change the final exception that ends up getting stored, if multiple exceptions are being thrown, but that shouldn't happen in practice.
1 parent 37fe2d7 commit a37b695

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/MySqlConnector/MySqlClient/Results/ResultSet.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public async Task<ResultSet> ReadResultSetHeaderAsync(IOBehavior ioBehavior, Can
2929
m_readBuffer.Clear();
3030
m_row = null;
3131
m_rowBuffered = null;
32-
MySqlException exception = null;
3332

3433
try
3534
{
@@ -71,7 +70,7 @@ public async Task<ResultSet> ReadResultSetHeaderAsync(IOBehavior ioBehavior, Can
7170
catch (Exception ex)
7271
{
7372
// store the exception, to be thrown after reading the response packet from the server
74-
exception = new MySqlException("Error during LOAD DATA LOCAL INFILE", ex);
73+
ReadResultSetHeaderException = new MySqlException("Error during LOAD DATA LOCAL INFILE", ex);
7574
}
7675

7776
await Session.SendReplyAsync(EmptyPayload.Create(), ioBehavior, cancellationToken).ConfigureAwait(false);
@@ -98,9 +97,6 @@ public async Task<ResultSet> ReadResultSetHeaderAsync(IOBehavior ioBehavior, Can
9897
break;
9998
}
10099
}
101-
102-
if (exception != null)
103-
throw exception;
104100
}
105101
catch (Exception ex)
106102
{

0 commit comments

Comments
 (0)