Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Sass error output #296

Merged
merged 2 commits into from Aug 14, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion tasks/sass.js
Expand Up @@ -36,6 +36,8 @@ module.exports = grunt => {
grunt.file.write(filePath, result.map);
}
}));
})().catch(grunt.fatal).then(done);
})().catch(error => {
grunt.fatal(error.formatted);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error here is not guaranteed to only be the Sass error, so the .formatted property may or may not exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I change to error.formatted || error ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or, maybe, wrap render with try ... catch and throw error with formatted message?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I change to error.formatted || error ?

👍

}).then(done);
});
};