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

Commit 4893773

Browse files
committed
CR updates
1 parent 2eda8e0 commit 4893773

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/core/ipfs/files.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,15 @@ module.exports = function files (self) {
102102

103103
cat: promisify((hash, callback) => {
104104
if (typeof hash === 'function') {
105-
callback = hash
106-
return callback('You must supply a multihash', null)
105+
return callback(new Error('You must supply a multihash'))
107106
}
108107
self._dagS.get(hash, (err, fetchedNode) => {
109108
if (err) {
110-
return callback(err, null)
109+
return callback(err)
111110
}
112111
const data = UnixFS.unmarshal(fetchedNode.data)
113112
if (data.type === 'directory') {
114-
callback('This dag node is a directory', null)
113+
callback(new Error('This dag node is a directory'))
115114
} else {
116115
const exportStream = Exporter(hash, self._dagS)
117116
exportStream.once('data', (object) => {

0 commit comments

Comments
 (0)