Skip to content

Commit 6959dce

Browse files
authored
Include error code for downstream exception handling
1 parent 919b4ca commit 6959dce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MySqlConnector/MySql.Data.MySqlClient/MySqlConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ private async ValueTask<ServerSession> CreateSessionAsync(IOBehavior? ioBehavior
528528
}
529529
catch (OperationCanceledException ex) when (timeoutSource?.IsCancellationRequested ?? false)
530530
{
531-
throw new MySqlException("Connect Timeout expired.", ex);
531+
throw new MySqlException((int) MySqlErrorCode.UnableToConnectToHost, null, "Connect Timeout expired.", ex);
532532
}
533533
finally
534534
{

0 commit comments

Comments
 (0)