add DuplicateKeyException

This commit is contained in:
Michael Becker 2025-01-05 17:07:38 -05:00
parent 93f8790653
commit cf72623dbc

View File

@ -0,0 +1,24 @@
using System;
namespace MBS.Core.Collections;
/// <summary>
/// The exception thrown when an item with the same key has already been added.
/// </summary>
public class DuplicateKeyException : ArgumentException
{
public DuplicateKeyException() : base("An item with the same key has already been added.")
{
}
public DuplicateKeyException(Exception? innerException) : base("An item with the same key has already been added.", innerException)
{
}
public DuplicateKeyException(string? message) : base(message) { }
public DuplicateKeyException(string? message, Exception? innerException) : base(message, innerException) { }
public DuplicateKeyException(string? message, string? paramName) : base(message, paramName) { }
public DuplicateKeyException(string? message, string? paramName, Exception? innerException) : base(message, paramName, innerException) { }
}