Skip to content

Commit

Permalink
Print error message for errors without error codes and cleanup defaul…
Browse files Browse the repository at this point in the history
…t error sting
  • Loading branch information
razzeee committed Aug 28, 2018
1 parent f398975 commit b6c187a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ function compilerErrorToString(err, pathToElm) {
default:
return ("Error attempting to run Elm compiler \"" + pathToElm + "\":\n" + err);
}
} else if ((typeof err === "object") && (typeof err.message === "string")) {
return (JSON.stringify(err.message));
} else {
return ("Exception thrown when attempting to run Elm compiler " + JSON.stringify(pathToElm) + ":\n");
return ("Exception thrown when attempting to run Elm compiler " + JSON.stringify(pathToElm));
}
}

Expand Down

0 comments on commit b6c187a

Please sign in to comment.