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

fix: fix bug introduced by 1143 #1146

Merged
merged 1 commit into from
Dec 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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