-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code(API::DAL): Add custom exceptions for Assistant entities
- Loading branch information
1 parent
93a9e03
commit 7731a66
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
...StellarChat.Server.Api/DAL/Mongo/Exceptions/Assistants/AssistantAlreadyExistsException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace StellarChat.Server.Api.DAL.Mongo.Exceptions.Assistants; | ||
|
||
public class AssistantAlreadyExistsException : StellarChatException | ||
{ | ||
public Guid Id { get; } | ||
|
||
public AssistantAlreadyExistsException(Guid id) | ||
: base( | ||
message: $"Assistant with Id: '{id}' already exists.", | ||
userMessage: $"An assistant with the same details already exists.") | ||
=> Id = id; | ||
} |
13 changes: 13 additions & 0 deletions
13
...rver/StellarChat.Server.Api/DAL/Mongo/Exceptions/Assistants/AssistantNotFoundException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace StellarChat.Server.Api.DAL.Mongo.Exceptions.Assistants; | ||
|
||
public class AssistantNotFoundException : StellarChatException | ||
{ | ||
public Guid Id { get; } | ||
|
||
public AssistantNotFoundException(Guid id) | ||
: base( | ||
message: $"Assistant message with ID: {id} not found.", | ||
userMessage: $"The requested assistant could not be found.") | ||
=> Id = id; | ||
} | ||
|