Dashboard sipadu mbip
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

Error.js 642B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * **PostCSS Syntax Error**
  3. *
  4. * Loader wrapper for postcss syntax errors
  5. *
  6. * @class SyntaxError
  7. * @extends Error
  8. *
  9. * @param {Object} err CssSyntaxError
  10. */
  11. class SyntaxError extends Error {
  12. constructor (error) {
  13. super(error)
  14. const { line, column, reason } = error
  15. this.name = 'SyntaxError'
  16. this.message = `${this.name}\n\n`
  17. if (typeof line !== 'undefined') {
  18. this.message += `(${line}:${column}) `
  19. }
  20. this.message += `${reason}`
  21. const code = error.showSourceCode()
  22. if (code) {
  23. this.message += `\n\n${code}\n`
  24. }
  25. this.stack = false
  26. }
  27. }
  28. module.exports = SyntaxError