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

Improve Sass error output #296

merged 2 commits into from Aug 14, 2019

Conversation

toptalo
Copy link
Contributor

@toptalo toptalo commented Aug 8, 2019

Fixes #293

tasks/sass.js Outdated
@@ -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 ?

👍

@sindresorhus sindresorhus changed the title Change error output source Improve the error output Aug 14, 2019
@sindresorhus sindresorhus changed the title Improve the error output Improve Sass error output Aug 14, 2019
@sindresorhus sindresorhus merged commit 08df45d into sindresorhus:master Aug 14, 2019
@toptalo toptalo deleted the issue-293 branch August 14, 2019 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More descriptive errors for undefined variables
2 participants