ipfs/kubo

Provide sentinel errors in the HTTP API

Open

#7.307 aberto em 12 de mai. de 2020

Ver no GitHub
 (3 comments) (0 reactions) (0 assignees)Go (2.725 forks)batch import
P3help wantedkind/enhancementstatus/readytopic/rpc-api

Métricas do repositório

Stars
 (13.906 stars)
Métricas de merge de PR
 (Mesclagem média 4d 2h) (28 fundiu PRs em 30d)

Description

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.

Guia do colaborador