Skip to content

Commit

Permalink
Code(API::DAL): Add custom exceptions for Assistant entities
Browse files Browse the repository at this point in the history
  • Loading branch information
ktutak1337 committed May 7, 2024
1 parent 93a9e03 commit 7731a66
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
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;
}
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;
}

0 comments on commit 7731a66

Please sign in to comment.