errors.gno
1.13 Kb ยท 30 lines
1package blog
2
3import "errors"
4
5var (
6 ErrPostAlreadyExists = errors.New("post already exists")
7
8 ErrPostNotFound = errors.New("post not found")
9 ErrCommentNotFound = errors.New("comment not found")
10 ErrLikesDisabled = errors.New("likes are disabled")
11 ErrAlreadyLiked = errors.New("this address has already liked")
12 ErrNotLiked = errors.New("this address hasn't liked yet")
13
14 ErrInvalidPostID = errors.New("invalid post ID")
15 ErrInvalidCommentID = errors.New("invalid comment ID")
16 ErrInvalidPost = errors.New("post not found/ invalid")
17
18 ErrEmptyPrefix = errors.New("prefix cannot be empty")
19 ErrEmptyTitle = errors.New("title cannot be empty")
20 ErrEmptyBody = errors.New("body cannot be empty")
21 ErrEmptySlug = errors.New("slug cannot be empty")
22 ErrEmptyComment = errors.New("content of comment cannot be empty")
23
24 ErrDeleteFailed = errors.New("delete operation failed")
25 ErrUnlikeFailed = errors.New("failed to unlike post")
26 ErrCommentDeleteFailed = errors.New("failed to delete comment")
27
28 ErrInvalidCaller = errors.New("invalid caller address")
29 ErrNotSuperuser = errors.New("address is not owner")
30)