Skip to content

Commit d85a77b

Browse files
marcelkenlayChoc13
authored andcommitted
Add new implementation of Error class for a Conflict error (#12)
1 parent 3fc8e84 commit d85a77b

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,8 @@ Extends `Error` to indicate that an entity could not be found.
9797

9898
### `UnauthorizedError`
9999

100-
Extends `Error` to indicate that the action being performed is not authorized.
100+
Extends `Error` to indicate that the action being performed is not authorized.
101+
102+
### `ConflictError`
103+
104+
Extends `Error` to indicate the action cannot be completed due to the existence of a conflicting entity.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) Winton. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
3+
4+
namespace Winton.DomainModelling
5+
{
6+
/// <inheritdoc />
7+
/// <summary>
8+
/// An error indicating that a conflicting entity exists.
9+
/// </summary>
10+
public class ConflictError : Error
11+
{
12+
/// <summary>
13+
/// Initializes a new instance of the <see cref="ConflictError" /> class.
14+
/// </summary>
15+
/// <param name="detail">The detail that describes the error.</param>
16+
/// <returns>A new instance of <see cref="ConflictError" />.</returns>
17+
public ConflictError(string detail)
18+
: base("Conflict", detail)
19+
{
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)