ipfs/kubo

Provide sentinel errors in the HTTP API

Open

#7,307 建立於 2020年5月12日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)Go (13,906 star) (2,725 fork)batch import
P3help wantedkind/enhancementstatus/readytopic/rpc-api

描述

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.

貢獻者指南