using System; using System.Text; namespace Xylem.Common.CommonCore.Exceptions.WaterMeter { public class LvlNotSupportedException : Exception, ICommonException { Guid? _lCode; public LvlNotSupportedException(Guid? location = null) { _lCode = location; } public LvlNotSupportedException(String message, Guid? location = null) : base(message) { _lCode = location; } public LvlNotSupportedException(String message, Exception inner, Guid? location = null) : base(message, inner) { _lCode = location; } public String GetHelpText() { var sb = new StringBuilder(); sb.AppendLine("You can not login at this lvl if the meter is locked."); sb.AppendLine("Try to use an other level or unlock the meter."); if (_lCode.HasValue) { sb.AppendLine($"LCode:{_lCode.Value}"); } return sb.ToString(); } } }