laatzen/Common/CommonCore/Exceptions/DB/NoKeyException.cs

41 lines
1.0 KiB
C#
Raw Normal View History

2021-10-01 09:09:20 +00:00
using System;
using System.Text;
namespace Xylem.Common.CommonCore.Exceptions.Db
{
public class NoKeyStoredException : Exception, ICommonException
{
2022-08-24 09:42:44 +00:00
Guid? _lCode;
public NoKeyStoredException(Guid? location = null)
2021-10-01 09:09:20 +00:00
{
2022-08-24 09:42:44 +00:00
_lCode = location;
2021-10-01 09:09:20 +00:00
}
2022-08-24 09:42:44 +00:00
public NoKeyStoredException(String message, Guid? location = null)
2021-10-01 09:09:20 +00:00
: base(message)
{
2022-08-24 09:42:44 +00:00
_lCode = location;
2021-10-01 09:09:20 +00:00
}
2022-08-24 09:42:44 +00:00
public NoKeyStoredException(String message, Exception inner, Guid? location = null)
2021-10-01 09:09:20 +00:00
: base(message, inner)
{
2022-08-24 09:42:44 +00:00
_lCode = location;
2021-10-01 09:09:20 +00:00
}
2022-08-24 09:42:44 +00:00
public String GetHelpText()
2021-10-01 09:09:20 +00:00
{
var sb = new StringBuilder();
2022-08-24 09:42:44 +00:00
sb.AppendLine("Report this to a developer or database admin.");
sb.AppendLine("Something went wrong while store the keyset on BSI.");
2021-10-01 09:09:20 +00:00
2022-08-24 09:42:44 +00:00
if (_lCode.HasValue)
2021-10-01 09:09:20 +00:00
{
2022-08-24 09:42:44 +00:00
sb.AppendLine($"LCode:{_lCode.Value}");
2021-10-01 09:09:20 +00:00
}
return sb.ToString();
}
}
}