laatzen/Common/CommonCore/Exceptions/Web/TokenRequiredException.cs
2021-10-01 11:09:20 +02:00

41 lines
1.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
namespace Xylem.Common.CommonCore.Exceptions
{
public class TokenRequiredException : Exception, ICommonException
{
Guid? LCode = null;
public TokenRequiredException(Guid? Location = null)
{
LCode = Location;
}
public TokenRequiredException(string message, Guid? Location = null)
: base(message)
{
LCode = Location;
}
public TokenRequiredException(string message, Exception inner, Guid? Location = null)
: base(message, inner)
{
LCode = Location;
}
public string GetHelpText()
{
var sb = new StringBuilder();
sb.AppendLine($"Token is required for locked meter.");
sb.AppendLine($"Add token too your local key store.");
if (LCode.HasValue)
{
sb.AppendLine($"LCode:{LCode.Value}");
}
return sb.ToString();
}
}
}