2024-10-25 17:30:27 +02:00
|
|
|
|
using System;
|
2024-04-23 14:50:01 +02:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
2024-10-25 17:30:27 +02:00
|
|
|
|
namespace BS.Shared.Exceptions
|
2024-04-23 14:50:01 +02:00
|
|
|
|
{
|
2024-10-25 17:30:27 +02:00
|
|
|
|
public class GkvException : ArgumentException
|
2024-04-23 14:50:01 +02:00
|
|
|
|
{
|
2024-06-11 14:31:17 +02:00
|
|
|
|
public string Title { get; set; }
|
2024-07-05 14:00:04 +02:00
|
|
|
|
public override string Message { get; }
|
2024-04-23 14:50:01 +02:00
|
|
|
|
|
2024-10-25 17:30:27 +02:00
|
|
|
|
public GkvException(string message, string title) : this(message)
|
2024-06-11 14:31:17 +02:00
|
|
|
|
{
|
|
|
|
|
|
Title = title;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-25 17:30:27 +02:00
|
|
|
|
public GkvException(string message) : this()
|
2024-04-23 14:50:01 +02:00
|
|
|
|
{
|
|
|
|
|
|
Message = message;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-25 17:30:27 +02:00
|
|
|
|
public GkvException()
|
2024-04-23 14:50:01 +02:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2024-10-30 11:43:23 +01:00
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
|
{
|
|
|
|
|
|
var sb = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(Title))
|
|
|
|
|
|
sb.Append(Title + " - ");
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(Message))
|
|
|
|
|
|
sb.Append(Message + " - ");
|
|
|
|
|
|
|
|
|
|
|
|
if(sb.Length == 0)
|
|
|
|
|
|
sb.Append(base.ToString());
|
|
|
|
|
|
|
|
|
|
|
|
return sb.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-04-23 14:50:01 +02:00
|
|
|
|
}
|