-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add code docs; Change Error Struct; (#22)
- Loading branch information
1 parent
b3d353b
commit bc8d1a1
Showing
14 changed files
with
119 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Пакет определяющий кастомные ошибки. Содержит саму ошбку, | ||
// которая будет отображаться в логах и текст, который будет отправлен пользователю. | ||
package customerrors | ||
|
||
import "fmt" | ||
|
||
type CustomError error | ||
|
||
// перечень кастомных ошибок | ||
var ( | ||
ErrNotSupportedURL CustomError = fmt.Errorf("notSupported") | ||
ErrNotUniqSuggestion CustomError = fmt.Errorf("notUniqSuggestion") | ||
) | ||
|
||
// перечень сообщений, которые будут отправлены пользователю. | ||
const ( | ||
ErrNotSupportedURLMessage string = "Данный URL не поддерживается" | ||
ErrNotUniqSuggestionMessage string = "Вы уже предлагали данную задачу." | ||
) | ||
|
||
var CustomErrors = map[CustomError]string{ | ||
ErrNotSupportedURL: ErrNotSupportedURLMessage, | ||
ErrNotUniqSuggestion: ErrNotUniqSuggestionMessage, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.