Files
softexpert-bot/errors/errors.py

21 lines
1.1 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class Error(str):
errors = {
0x00000000: 'Неизвестная ошибка.',
0x00000001: 'Выберете из предложенного.',
0x00000002: 'Текст слишком длинный.',
0x00000003: 'Введите корректный адрес электронной почты.',
0x00000004: 'Введите корректный номер телефона.',
0x00000005: 'К сожалению, бот не способен обрабатывать заказы этой подкатегории.\n\nСвяжитесь с нами любым удобным для вас способом:\n+7 (4872) 70-02-70 — телефон в Туле;\n8-800-775-15-40 — по России бесплатно;\nsfx@sfx-tula.ru — электронная почта.',
}
def __new__(cls, code):
self = str.__new__(Error)
self.code = code
return self
def __str__(self):
return '<b>Ошибка 0x%.8X!</b>\n%s' % (
self.code,
self.errors[self.code],
)