Skip to content

Commit

Permalink
Repair so error on npm -ls becomes a warning
Browse files Browse the repository at this point in the history
* Added `try...catch` just in case it's a fatal error

**NOTES**

``` sh-session
problems": [

    "peer dep missing: kerberos@~0.0, required by mongodb-core@1.2.21"

],
```

... this shows up in the stdout as being the "error" along with the full compliment of packages installed ... see OpenUserJS#832 and parent OpenUserJS#318

*(never would have guessed this on nodejitsu... glad we aren't there anymore)*
  • Loading branch information
Martii committed Nov 19, 2015
1 parent f0614af commit 448ef4a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions controllers/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,14 @@ exports.adminNpmListView = function (aReq, aRes, aNext) {

exec('npm ls --json', function (aErr, aStdout, aStderr) {
if (aErr) {
aRes.status(501).send({ status: 501, message: 'Not implemented.' });
return;
console.warn(aErr);
}

aRes.json(JSON.parse(aStdout));
try {
aRes.json(JSON.parse(aStdout));
} catch (aE) {
aRes.status(520).send({ status: 520, message: 'Unknown error.' });
}
});
};

Expand Down

0 comments on commit 448ef4a

Please sign in to comment.