using System; using System.Text; namespace Xylem.Common.CommonCore.Exceptions.Web { public class TokenRequiredException : Exception, ICommonException { Guid? _lCode; 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(); } } }