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

Commit

Permalink
fix: fix bug introduced by 1143 (#1146)
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias authored and richardschneider committed Dec 17, 2017
1 parent 9e1cd3e commit 08d8a5d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/http/api/resources/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ exports.cat = {
ipfs.files.cat(key, (err, stream) => {
if (err) {
log.error(err)
return reply({
Message: 'Failed to cat file: ' + err,
Code: 0
}).code(500)
if (err.message === 'No such file') {
reply({Message: 'No such file'}).code(500)
} else {
reply({Message: 'Failed to cat file: ' + err, Code: 0}).code(500)
}
return
}

// hapi is not very clever and throws if no
Expand Down

0 comments on commit 08d8a5d

Please sign in to comment.