Files
Yi.Framework/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/AiChat/ChatErrorException.cs
2025-07-02 00:28:44 +08:00

31 lines
754 B
C#

using Microsoft.Extensions.Logging;
namespace Yi.Framework.AiHub.Domain.AiChat;
public class ChatErrorException : Exception
{
public string? Code { get; set; }
public string? Details { get; set; }
public LogLevel LogLevel { get; set; }
public ChatErrorException(
string? code = null,
string? message = null,
string? details = null,
Exception? innerException = null,
LogLevel logLevel = LogLevel.Warning)
: base(message, innerException)
{
this.Code = code;
this.Details = details;
this.LogLevel = logLevel;
}
public ChatErrorException WithData(string name, object value)
{
this.Data[(object)name] = value;
return this;
}
}