Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit e04aa0c

Browse files
authored
docs: improved errors
1 parent 6474a77 commit e04aa0c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

gateway.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (api *bifrostGateway) GetIPNSRecord(ctx context.Context, c cid.Cid) ([]byte
121121
return nil, errors.New("provided cid is not an encoded libp2p key")
122122
}
123123

124-
// The value store expects the key itself to be encoded as a multihash.
124+
// The value store expects the key itself to be multihash.
125125
id, err := peer.FromCid(c)
126126
if err != nil {
127127
return nil, err

routing.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func (ps *proxyRouting) fetch(ctx context.Context, key string) ([]byte, error) {
113113
var evt routing.QueryEvent
114114
err = json.Unmarshal(part, &evt)
115115
if err != nil {
116-
return nil, fmt.Errorf("routing/get value cannot be parsed: %w", err)
116+
return nil, fmt.Errorf("/api/v0/routing/get response cannot be parsed: %w", err)
117117
}
118118

119119
if evt.Type == routing.Value {
@@ -123,7 +123,7 @@ func (ps *proxyRouting) fetch(ctx context.Context, key string) ([]byte, error) {
123123
}
124124

125125
if b64 == "" {
126-
return nil, errors.New("routing/get value has no key")
126+
return nil, errors.New("/api/v0/routing/get returned no value")
127127
}
128128

129129
rb, err = base64.StdEncoding.DecodeString(b64)

0 commit comments

Comments
 (0)