ipfs/kubo

Provide sentinel errors in the HTTP API

Open

#7307 aperta il 12 mag 2020

Vedi su GitHub
 (3 commenti) (0 reazioni) (0 assegnatari)Go (2725 fork)batch import
P3help wantedkind/enhancementstatus/readytopic/rpc-api

Metriche repository

Star
 (13.906 star)
Metriche merge PR
 (Merge medio 4g 2h) (28 PR mergiate in 30 g)

Descrizione

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.

Guida contributor