Something went wrong. Try again.
A community based topic aggregation platform built on atproto
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152package comments
import "errors"
var ( // ErrCommentNotFound indicates the requested comment doesn't exist ErrCommentNotFound = errors.New("comment not found")
// ErrInvalidReply indicates the reply reference is malformed or invalid ErrInvalidReply = errors.New("invalid reply reference")
// ErrParentNotFound indicates the parent post/comment doesn't exist ErrParentNotFound = errors.New("parent post or comment not found")
// ErrRootNotFound indicates the root post doesn't exist ErrRootNotFound = errors.New("root post not found")
// ErrContentTooLong indicates comment content exceeds 3000 graphemes ErrContentTooLong = errors.New("comment content exceeds 3000 graphemes")
// ErrContentEmpty indicates comment content is empty ErrContentEmpty = errors.New("comment content is required")
// ErrNotAuthorized indicates the user is not authorized to perform this action ErrNotAuthorized = errors.New("not authorized")
// ErrBanned indicates the user is banned from the community ErrBanned = errors.New("user is banned from this community")
// ErrCommentAlreadyExists indicates a comment with this URI already exists ErrCommentAlreadyExists = errors.New("comment already exists"))
// IsNotFound checks if an error is a "not found" errorfunc IsNotFound(err error) bool { return errors.Is(err, ErrCommentNotFound) || errors.Is(err, ErrParentNotFound) || errors.Is(err, ErrRootNotFound)}
// IsConflict checks if an error is a conflict/already exists errorfunc IsConflict(err error) bool { return errors.Is(err, ErrCommentAlreadyExists)}
// IsValidationError checks if an error is a validation errorfunc IsValidationError(err error) bool { return errors.Is(err, ErrInvalidReply) || errors.Is(err, ErrContentTooLong) || errors.Is(err, ErrContentEmpty)}