Search Apps Documentation Source Content File Folder Download Copy Actions Download

errors.gno

0.57 Kb ยท 20 lines
 1package referral
 2
 3import (
 4	"errors"
 5
 6	"gno.land/p/nt/ufmt"
 7)
 8
 9var (
10	ErrInvalidAddress  = errors.New("invalid address format")
11	ErrSelfReferral    = errors.New("self referral is not allowed")
12	ErrUnauthorized    = errors.New("unauthorized caller")
13	ErrTooManyRequests = errors.New("too many requests: operations allowed once per 24 hours for each address")
14	ErrNotFound        = errors.New("referral not found")
15	ErrInvalidTime     = errors.New("invalid time format")
16)
17
18func makeErrorWithDetails(err error, detail string) error {
19	return ufmt.Errorf("%s: %s", err.Error(), detail)
20}