github.com/decred/dcrlnd@v0.7.6/channeldb/migration_01_to_11/error.go (about) 1 package migration_01_to_11 2 3 import ( 4 "fmt" 5 ) 6 7 var ( 8 // ErrNoInvoicesCreated is returned when we don't have invoices in 9 // our database to return. 10 ErrNoInvoicesCreated = fmt.Errorf("there are no existing invoices") 11 12 // ErrNoPaymentsCreated is returned when bucket of payments hasn't been 13 // created. 14 ErrNoPaymentsCreated = fmt.Errorf("there are no existing payments") 15 16 // ErrGraphNotFound is returned when at least one of the components of 17 // graph doesn't exist. 18 ErrGraphNotFound = fmt.Errorf("graph bucket not initialized") 19 20 // ErrSourceNodeNotSet is returned if the source node of the graph 21 // hasn't been added The source node is the center node within a 22 // star-graph. 23 ErrSourceNodeNotSet = fmt.Errorf("source node does not exist") 24 25 // ErrGraphNodeNotFound is returned when we're unable to find the target 26 // node. 27 ErrGraphNodeNotFound = fmt.Errorf("unable to find node") 28 29 // ErrEdgeNotFound is returned when an edge for the target chanID 30 // can't be found. 31 ErrEdgeNotFound = fmt.Errorf("edge not found") 32 33 // ErrUnknownAddressType is returned when a node's addressType is not 34 // an expected value. 35 ErrUnknownAddressType = fmt.Errorf("address type cannot be resolved") 36 37 // ErrNoClosedChannels is returned when a node is queries for all the 38 // channels it has closed, but it hasn't yet closed any channels. 39 ErrNoClosedChannels = fmt.Errorf("no channel have been closed yet") 40 41 // ErrEdgePolicyOptionalFieldNotFound is an error returned if a channel 42 // policy field is not found in the db even though its message flags 43 // indicate it should be. 44 ErrEdgePolicyOptionalFieldNotFound = fmt.Errorf("optional field not " + 45 "present") 46 ) 47 48 // ErrTooManyExtraOpaqueBytes creates an error which should be returned if the 49 // caller attempts to write an announcement message which bares too many extra 50 // opaque bytes. We limit this value in order to ensure that we don't waste 51 // disk space due to nodes unnecessarily padding out their announcements with 52 // garbage data. 53 func ErrTooManyExtraOpaqueBytes(numBytes int) error { 54 return fmt.Errorf("max allowed number of opaque bytes is %v, received "+ 55 "%v bytes", MaxAllowedExtraOpaqueBytes, numBytes) 56 }