From 31031b88e0bc97a04550ca8893977385bf3884b4 Mon Sep 17 00:00:00 2001 From: Viktor Panasyuk Date: Sun, 17 Dec 2023 21:09:45 +0300 Subject: [PATCH] fix: errors handling assignment example usage --- modules/40-func/35-errors-handling/description.ru.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/40-func/35-errors-handling/description.ru.yml b/modules/40-func/35-errors-handling/description.ru.yml index f6cf4a0..e077aa9 100644 --- a/modules/40-func/35-errors-handling/description.ru.yml +++ b/modules/40-func/35-errors-handling/description.ru.yml @@ -148,8 +148,8 @@ instructions: | Реализуйте функцию `GetErrorMsg(err error) string`, которая возвращает текст ошибки, если она критичная. В случае неизвестной ошибки возвращается строка *unknown error*: ```go - GetErrorMsg(errors.New("bad connection")) // "bad connection" - GetErrorMsg(errors.New("bad request")) // "bad request" + GetErrorMsg(errBadConnection) // "bad connection" + GetErrorMsg(errBadRequest) // "bad request" GetErrorMsg(nonCriticalError{}) // "" GetErrorMsg(errors.New("random error")) // "unknown error" ```