laatzen/Common/CommonCore/Exceptions/WaterMeter/LvlNotSupportedException.cs
2022-08-24 11:42:44 +02:00

39 lines
1.0 KiB
C#

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();
}
}
}