forked from npgsql/npgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNpgsqlOperationInProgressException.cs
More file actions
28 lines (25 loc) · 1.04 KB
/
NpgsqlOperationInProgressException.cs
File metadata and controls
28 lines (25 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
namespace Npgsql
{
/// <summary>
/// Thrown when trying to use a connection that is already busy performing some other operation.
/// Provides information on the already-executing operation to help with debugging.
/// </summary>
public sealed class NpgsqlOperationInProgressException : InvalidOperationException
{
internal NpgsqlOperationInProgressException(NpgsqlCommand command)
: base("A command is already in progress: " + command.CommandText)
{
CommandInProgress = command;
}
internal NpgsqlOperationInProgressException(ConnectorState state)
: base($"The connection is already in state '{state}'")
{
}
/// <summary>
/// If the connection is busy with another command, this will contain a reference to that command.
/// Otherwise, if the connection if busy with another type of operation (e.g. COPY), contains null.
/// </summary>
public NpgsqlCommand? CommandInProgress { get; }
}
}