Commit 9f7a78d8 by Adeel

Errors: Convert errors to JS objects.

For CLI format as JSON with indent = 2.
parent a8c67109
......@@ -152,6 +152,12 @@ function getOptions(options) {
var success = options.success;
options.error = function(err, code) {
try {
err = JSON.parse(err);
} catch (e) {
err = { message: err };
}
if (error) {
error(err, code);
}
......
......@@ -72,7 +72,7 @@ module.exports = function(options, emitter) {
};
renderOptions.error = function(error) {
emitter.emit('error', chalk.red(error));
emitter.emit('error', chalk.red(JSON.stringify(error, null, 2)));
};
sass.render(renderOptions);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment