This repository was archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
Better error message when not initialized #1180
Copy link
Copy link
Closed
Labels
P2Medium: Good to have, but can wait until someone steps upMedium: Good to have, but can wait until someone steps upexp/noviceSomeone with a little familiarity can pick upSomeone with a little familiarity can pick uphelp wantedSeeking public contribution on this issueSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)A bug in existing code (including security flaws)status/in-progressIn progressIn progress
Description
- Version: js-ipfs version: 0.27.7
- Platform: Linux frea 4.14.0-2-amd64 Add to cli:
ipfs pin [-r] <ipfs-path>
#1 SMP Debian 4.14.7-1 (2017-12-22) x86_64 GNU/Linux - Subsystem: CLI
Type:
Bug
Severity:
Low
Description:
jsipfs block put
errors with an unhandled exception when IPFS wasn't previously initialized. Instead it should print a nice error that no repository was initialized and calling jsipfs init
first might make sense. Example:
$ jsipfs block put README.md
/home/vmx/src/pl/js-ipfs/node_modules/ipfs-block-service/src/index.js:64
this._repo.blocks.put(block, callback)
^
TypeError: Cannot read property 'put' of undefined
at BlockService.put (/home/vmx/src/pl/js-ipfs/node_modules/ipfs-block-service/src/index.js:64:23)
at waterfall (/home/vmx/src/pl/js-ipfs/src/core/components/block.js:51:43)
at nextTask (/home/vmx/src/pl/js-ipfs/node_modules/async/waterfall.js:16:14)
at next (/home/vmx/src/pl/js-ipfs/node_modules/async/waterfall.js:23:9)
at /home/vmx/src/pl/js-ipfs/node_modules/async/internal/onlyOnce.js:12:16
at waterfall (/home/vmx/src/pl/js-ipfs/src/core/components/block.js:31:20)
at nextTask (/home/vmx/src/pl/js-ipfs/node_modules/async/waterfall.js:16:14)
at exports.default (/home/vmx/src/pl/js-ipfs/node_modules/async/waterfall.js:26:5)
at Function.put.promisify (/home/vmx/src/pl/js-ipfs/src/core/components/block.js:28:7)
at Object.put (/home/vmx/src/pl/js-ipfs/node_modules/promisify-es6/index.js:32:27)
Steps to reproduce the error:
Make sure you don't have a repository (i.e. rm -Rf ~/.jsipfs
). Then run:
jsipfs block put <some-file>
Metadata
Metadata
Assignees
Labels
P2Medium: Good to have, but can wait until someone steps upMedium: Good to have, but can wait until someone steps upexp/noviceSomeone with a little familiarity can pick upSomeone with a little familiarity can pick uphelp wantedSeeking public contribution on this issueSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)A bug in existing code (including security flaws)status/in-progressIn progressIn progress