Skip to content

Commit e3f663b

Browse files
committed
comments, constructors
1 parent aee99ec commit e3f663b

1 file changed

Lines changed: 16 additions & 14 deletions

File tree

src/PolylineAlgorithm/Diagnostics/InvalidPolylineException.cs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@ namespace PolylineAlgorithm.Diagnostics;
1717
/// This exception is used internally to indicate that a polyline string does not conform to the expected format or contains errors.
1818
/// </remarks>
1919
[DebuggerDisplay($"{nameof(InvalidPolylineException)}: {{ToString()}}")]
20-
[SuppressMessage("Roslynator", "RCS1194:Implement exception constructors", Justification = "This exception is intended for use by consumers of the library, but additional constructors are not required for its intended usage.")]
21-
[SuppressMessage("Design", "CA1032:Implement standard exception constructors", Justification = "Standard exception constructors are not necessary for the intended usage of this exception type.")]
22-
public sealed class InvalidPolylineException : Exception {
20+
public sealed class InvalidPolylineException : Exception
21+
{
22+
/// <summary>
23+
/// Initializes a new instance of the <see cref="InvalidPolylineException"/> class.
24+
/// </summary>
25+
public InvalidPolylineException()
26+
: base() { }
27+
2328
/// <summary>
2429
/// Initializes a new instance of the <see cref="InvalidPolylineException"/> class with a specified error message.
2530
/// </summary>
@@ -30,17 +35,14 @@ internal InvalidPolylineException(string message)
3035
: base(message) { }
3136

3237
/// <summary>
33-
/// Throws an <see cref="InvalidPolylineException"/> with a message indicating the position in the polyline where the error was detected.
38+
/// Initializes a new instance of the <see cref="InvalidPolylineException"/> class with a specified error message and a reference to the inner exception that is the cause of this exception.
3439
/// </summary>
35-
/// <param name="position">
36-
/// The zero-based index in the polyline string where the error occurred.
40+
/// <param name="message">
41+
/// The error message that explains the reason for the exception.
3742
/// </param>
38-
/// <exception cref="InvalidPolylineException">
39-
/// Always thrown to indicate that the polyline is malformed at the specified position.
40-
/// </exception>
41-
internal static void Throw(long position) {
42-
Debug.Assert(position >= 0, "Position must be a non-negative value.");
43-
44-
ExceptionGuard.ThrowInvalidPolyline(position);
45-
}
43+
/// <param name="innerException">
44+
/// The exception that is the cause of the current exception, or a null reference if no inner exception is specified.
45+
/// </param>
46+
public InvalidPolylineException(string message, Exception innerException)
47+
: base(message, innerException) { }
4648
}

0 commit comments

Comments
 (0)