Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Should specify which link didn't exist on ipfs.cat #1145

Closed
daviddias opened this issue Dec 12, 2017 · 6 comments
Closed

Should specify which link didn't exist on ipfs.cat #1145

daviddias opened this issue Dec 12, 2017 · 6 comments
Assignees
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked

Comments

@daviddias
Copy link
Member

https://github.com/ipfs/js-ipfs/blob/master/src/core/components/files.js#L140 should report the same error as js-ipfs-api.

Example: ipfs-inactive/interface-js-ipfs-core#183 (comment)

//cc @pgte

@daviddias daviddias added kind/bug A bug in existing code (including security flaws) exp/expert Having worked on the specific codebase is important P2 Medium: Good to have, but can wait until someone steps up labels Dec 12, 2017
@daviddias
Copy link
Member Author

The HTTP API didn't get updated

  1) HTTP API
       ## interface-ipfs-core over ipfs-api
         .files
           .cat
             errors on unknown path:
     AssertionError: expected 'Failed to cat file: Error: No such file' to be one of [ Array(2) ]
      at ipfs.files.cat.catch (node_modules/interface-ipfs-core/src/files.js:439:36)
      at <anonymous>
      at process._tickDomainCallback (internal/process/next_tick.js:228:7)

@daviddias daviddias added status/ready Ready to be worked help wanted Seeking public contribution on this issue labels Jan 25, 2018
@vs77bb
Copy link

vs77bb commented Mar 5, 2018

@diasdavid Hi, Vivek from Gitcoin here. Is this something which might be helpful for us to bounty to get some developer eyes on it? We're a big fan of IPFS and would love to contribute, if helpful! Let us know if another issue is even more helpful (cc @owocki)

@youngnicks
Copy link

I'm new to ipfs, but am willing to give this a shot. It looks like it is just changing the error message in src/core/components/files.js from 'No such file' to no link named "${fileName}" under ${path}. Is this correct?

@youngnicks
Copy link

youngnicks commented Mar 17, 2018

If the above is true, should the ipfs/interface-ipfs-core be updated to remove No such file as a valid scenario? The test also fails due to the test looking for the error message thrown in files.cat, however, Failed to cat file: is prepended to the error message. I see other tests use expect(err.message).to.contain instead of expect(err.message).to.oneOf.

expect(err.message).to.contain(
  'no link named "does-not-exist" under Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP'
)

@hacdias hacdias added status/in-progress In progress and removed status/ready Ready to be worked labels May 10, 2018
@daviddias daviddias added status/ready Ready to be worked and removed status/in-progress In progress labels Jun 4, 2018
@niinpatel
Copy link
Contributor

Is this still open? Can I look into this?

MicrowaveDev pushed a commit to galtproject/js-ipfs that referenced this issue May 22, 2020
* feat: support name.resolve of peerid as cid

This is a hacky way to support CIDs when API is go-ipfs 0.4.22 or older
(convert toBase58btc before sending)

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
@achingbrain
Copy link
Member

Closing as this issue is very stale.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked
Projects
No open projects
Status: Done
7 participants