Skip to content

Commit 8a0cbe7

Browse files
authored
Make NpgsqlOperationInProgress inherit from NpgsqlException (#3153)
Closes #2864
1 parent 32d5721 commit 8a0cbe7

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/Npgsql/NpgsqlOperationInProgressException.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
using System;
2-
3-
namespace Npgsql
1+
namespace Npgsql
42
{
53
/// <summary>
64
/// Thrown when trying to use a connection that is already busy performing some other operation.
75
/// Provides information on the already-executing operation to help with debugging.
86
/// </summary>
9-
public sealed class NpgsqlOperationInProgressException : InvalidOperationException
7+
public sealed class NpgsqlOperationInProgressException : NpgsqlException
108
{
11-
internal NpgsqlOperationInProgressException(NpgsqlCommand command)
9+
/// <summary>
10+
/// Creates a new instance of <see cref="NpgsqlOperationInProgressException" />.
11+
/// </summary>
12+
/// <param name="command">
13+
/// A command which was in progress when the operation which triggered this exception was executed.
14+
/// </param>
15+
public NpgsqlOperationInProgressException(NpgsqlCommand command)
1216
: base("A command is already in progress: " + command.CommandText)
1317
{
1418
CommandInProgress = command;
@@ -21,7 +25,8 @@ internal NpgsqlOperationInProgressException(ConnectorState state)
2125

2226
/// <summary>
2327
/// If the connection is busy with another command, this will contain a reference to that command.
24-
/// Otherwise, if the connection if busy with another type of operation (e.g. COPY), contains null.
28+
/// Otherwise, if the connection if busy with another type of operation (e.g. COPY), contains
29+
/// <see langword="null" />.
2530
/// </summary>
2631
public NpgsqlCommand? CommandInProgress { get; }
2732
}

0 commit comments

Comments
 (0)