Skip to content

Commit

Permalink
Merge pull request #114 from enricforn/develop
Browse files Browse the repository at this point in the history
Extend parse error information
  • Loading branch information
t32k committed Apr 7, 2015
2 parents 080de92 + cfee36e commit c5a8192
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ var cssParse = require('css-parse');

var util = require('./util');

var currentFile;

/**
* Get promised request
* @param {Object} options
Expand Down Expand Up @@ -209,7 +211,7 @@ Parser.prototype.parse = function (callback) {
try {
rawRules = cssParse(parsedData.cssString).stylesheet.rules;
} catch (error) {
throw new Error('CSS parse error.');
throw new Error('CSS parse error in file ' + currentFile + '. Detailed error:' + error);
}

// check number of rules
Expand Down

0 comments on commit c5a8192

Please sign in to comment.