Files
BeWoPlaner/Shared/Exceptions/GkvException.cs

46 lines
963 B
C#
Raw Normal View History

2024-10-25 17:30:27 +02:00
using System;
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-10-25 17:30:27 +02:00
public class GkvException : ArgumentException
{
2024-06-11 14:31:17 +02:00
public string Title { get; set; }
public override string Message { get; }
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()
{
Message = message;
}
2024-10-25 17:30:27 +02:00
public GkvException()
{
}
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();
}
}
}