mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 17:35:16 +00:00
15 lines
460 B
JavaScript
15 lines
460 B
JavaScript
|
var createCustomError = require('../utils/createCustomError');
|
||
|
|
||
|
module.exports = function SyntaxError(message, input, offset) {
|
||
|
var error = createCustomError('SyntaxError', message);
|
||
|
|
||
|
error.input = input;
|
||
|
error.offset = offset;
|
||
|
error.rawMessage = message;
|
||
|
error.message = error.rawMessage + '\n' +
|
||
|
' ' + error.input + '\n' +
|
||
|
'--' + new Array((error.offset || error.input.length) + 1).join('-') + '^';
|
||
|
|
||
|
return error;
|
||
|
};
|