✨ Awesome Error Handling in Sass
npm install sass-errors --save-dev
Documentation: https://ncoden.github.io/sass-errors/docs
@import 'sass-errors';
@import 'sass-errors-alias'; // se- alias
@function division($number, $divisor) {
@if $divisor == 0 {
@return se-throw('Dividor cannot equal to 0.', 'dividor_zero');
}
@return $number / $divisor;
}
$ret: division(42, 0); // -> false
$e: se-catch();
@if $e {
// Display @error 'Dividor cannot equal to 0.'
$_: se-error($e);
}
Version 0.4.1 - MIT License.