Skip to content

Commit

Permalink
Correct bug in ScriptController - Crashing when error was not an object
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles committed Sep 21, 2015
1 parent dfa8292 commit be5a6b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/controllers/ScriptController.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ function validFileName(name){

function stringifyError (err, filter, space) {
var plainObject = {};
if (err instanceof Object == false) {
return JSON.stringify(err);
}
Object.getOwnPropertyNames(err).forEach(function(key) {
plainObject[key] = err[key];
});
Expand Down

0 comments on commit be5a6b7

Please sign in to comment.