Skip to content

Commit 17f6fa6

Browse files
daniel-whiteYohDeadfall
authored andcommitted
Added constant error codes
1 parent c3747bb commit 17f6fa6

File tree

5 files changed

+490
-22
lines changed

5 files changed

+490
-22
lines changed

src/Npgsql/NpgsqlBinaryImporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ void Cancel()
336336
}
337337
catch (PostgresException e)
338338
{
339-
if (e.SqlState != "57014")
339+
if (e.SqlState != PostgresErrorCodes.QueryCanceled)
340340
throw;
341341
}
342342
}

src/Npgsql/NpgsqlRawCopyStream.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ public void Cancel()
229229
}
230230
catch (PostgresException e)
231231
{
232-
if (e.SqlState == "57014") { return; }
232+
if (e.SqlState == PostgresErrorCodes.QueryCanceled)
233+
return;
233234
throw;
234235
}
235236
}

0 commit comments

Comments
 (0)