Merge pull request #4 from billbitt/upload
handled non-500 daemon errors
This commit is contained in:
commit
f58d533469
1 changed files with 4 additions and 2 deletions
|
@ -4,8 +4,10 @@ module.exports = {
|
|||
handleRequestError: function(error, res) {
|
||||
if ((error === "NO_CLAIMS") || (error === "NO_FREE_PUBLIC_CLAIMS")){
|
||||
res.status(307).sendFile(path.join(__dirname, '../public', 'noClaims.html'));
|
||||
} else if (error.response.status === 500) {
|
||||
res.status(400).send(error.response.data.error.message);
|
||||
} else if (error.response){
|
||||
res.status(error.response.status).send(error.response.data.error.message);
|
||||
} else if (error.code === "ECONNREFUSED") {
|
||||
res.status(400).send("Connection refused. The daemon may not be running.");
|
||||
} else {
|
||||
res.status(400).send(error.toString());
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue