-
Notifications
You must be signed in to change notification settings - Fork 134
Open
Labels
good first issueGood issue for new contributorsGood issue for new contributorshelp wantedSeeking public contribution on this issueSeeking public contribution on this issue
Description
When adding content to Helia and setting the 'pin' option to true, if a pin exists the add method will throw a generic error with the message 'Already Pinned'.
The throw is here:
https://github.com/ipfs/helia/blob/main/packages/utils/src/pins.ts#L75
A couple of thoughts:
- If the content already exists and/or is already pinned, is this really an error? The goal of the client is to have the content pinned, if it is already pinned, the client desire is satisfied already, not unsatisfiable.
- If an error must be thrown, providing a specific error type or enumeration that could be reliably checked against would be helpful. Checking against an arbitrary message string seems fragile.
SgtPooki
Metadata
Metadata
Assignees
Labels
good first issueGood issue for new contributorsGood issue for new contributorshelp wantedSeeking public contribution on this issueSeeking public contribution on this issue