46 lines
963 B
C#
46 lines
963 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BS.Shared.Exceptions
|
|
{
|
|
public class GkvException : ArgumentException
|
|
{
|
|
public string Title { get; set; }
|
|
public override string Message { get; }
|
|
|
|
public GkvException(string message, string title) : this(message)
|
|
{
|
|
Title = title;
|
|
}
|
|
|
|
public GkvException(string message) : this()
|
|
{
|
|
Message = message;
|
|
}
|
|
|
|
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();
|
|
}
|
|
}
|
|
}
|