ipfs/kubo

Provide sentinel errors in the HTTP API

Open

#7.307 geöffnet am 12. Mai 2020

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Go (2.725 Forks)batch import
P3help wantedkind/enhancementstatus/readytopic/rpc-api

Repository-Metriken

Stars
 (13.906 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 4T 2h) (28 gemergte PRs in 30 T)

Beschreibung

Matching errors against concrete types would be nice vs. fragile error string matching, e.g.,

if err.Error() == "'from' cid was not recursively pinned already" { ...

Or, maybe using more fine grained error codes would be even better. I believe the above error will come with a code: ErrNormal or similar.

Contributor Guide