Search Apps Documentation Source Content File Folder Download Copy Actions Download

errors.gno

0.48 Kb · 17 lines
 1package common
 2
 3import (
 4	"errors"
 5
 6	ufmt "gno.land/p/nt/ufmt/v0"
 7)
 8
 9var (
10	errNotRegistered       = errors.New("[GNOSWAP-COMMON-001] token is not registered")
11	errNotHandleNativeCoin = errors.New("[GNOSWAP-COMMON-002] handle native coin is not allowed")
12)
13
14// newErrorWithDetail creates an error message with additional context in format "<original_error> || <detail>".
15func newErrorWithDetail(err error, detail string) string {
16	return ufmt.Errorf("%s || %s", err.Error(), detail).Error()
17}