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 committed Dec 13, 2017
1 parent a6dce4f commit 12cdc08
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 12cdc08

Please sign in to comment.