Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

errors.gno

1.30 Kb · 37 lines
 1package dca
 2
 3import (
 4	ufmt "gno.land/p/nt/ufmt/v0"
 5)
 6
 7// Proxy errors carry no error code; codes belong to the implementation.
 8
 9// ErrSpoofedRealm is returned when a store write gets a non-current realm.
10const ErrSpoofedRealm = "spoofed realm"
11
12// ErrNilInitializer is raised by RegisterInitializer for a nil factory.
13const ErrNilInitializer = "nil initializer"
14
15// ErrUpgradeWhileExecuting is raised by UpgradeImpl during a group swap.
16const ErrUpgradeWhileExecuting = "cannot upgrade while a group execution is in progress"
17
18// ErrInvalidSwapCallback is returned by a round's swap callback for a call it
19// must not pay: not from the pool, outside a round, a second payment, or a
20// delta that is not the round's exact input (e.g. a pool without liquidity
21// owes nothing).
22const ErrInvalidSwapCallback = "invalid swap callback"
23
24const (
25	errImplNotInitialized = "implementation is not initialized"
26	errInvalidImpl        = "impl is not an IDCAOrder"
27	errInvalidDomainStore = "domainStore is not an IDCAOrderStore"
28	errNilConfig          = "config is nil"
29
30	// Format strings: the store key name, the config value.
31	errNilValue          = "%s is nil"
32	errInvalidConfigType = "failed to cast config: %T"
33)
34
35func makeErrorWithDetails(message string, details string) error {
36	return ufmt.Errorf("%s || %s", message, details)
37}