refactor: rename MaxLengthException & fix naming

This commit is contained in:
ZavaruKitsu
2022-10-15 21:59:12 +03:00
parent fb51677429
commit 9400cfc74e
6 changed files with 33 additions and 30 deletions
@@ -1,11 +0,0 @@
using System;
namespace TelegramBotBase.Exceptions;
public class MaxLengthException : Exception
{
public MaxLengthException(int length) : base(
$"Your messages with a length of {length} is too long for telegram. Actually is {Constants.Telegram.MaxMessageLength} characters allowed. Please split it.")
{
}
}
@@ -2,13 +2,11 @@
namespace TelegramBotBase.Exceptions;
public class MaximumColsException : Exception
public sealed class MaximumColsException : Exception
{
public int Value { get; set; }
public int Maximum { get; set; }
public override string Message =>
$"You have exceeded the maximum of columns by {Value.ToString()} / {Maximum.ToString()}";
}
$"You have exceeded the maximum of columns by {Value}/{Maximum}";
}
@@ -2,7 +2,7 @@
namespace TelegramBotBase.Exceptions;
public class MaximumRowsReachedException : Exception
public sealed class MaximumRowsReachedException : Exception
{
public int Value { get; set; }
@@ -10,5 +10,5 @@ public class MaximumRowsReachedException : Exception
public override string Message =>
$"You have exceeded the maximum of rows by {Value.ToString()} / {Maximum.ToString()}";
}
$"You have exceeded the maximum of rows by {Value}/{Maximum}";
}
@@ -0,0 +1,16 @@
using System;
namespace TelegramBotBase.Exceptions;
public sealed class MessageTooLongException : Exception
{
public MessageTooLongException(int length)
{
Length = length;
}
public int Length { get; set; }
public override string Message =>
$"You have exceeded the maximum of message length by {Length}/{Constants.Telegram.MaxMessageLength}";
}