90e7b9cc4444144564f7a1c6e21edb59e9be15c4dfa0ce825b3337355e58dd129aea05e9f3bce66df400a9015790cbf5d8ede98af9a87765aff6a11024ac8b 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import {SourceSpan} from './logger';
  2. /**
  3. * An exception thrown because a Sass compilation failed.
  4. *
  5. * @category Other
  6. */
  7. export class Exception extends Error {
  8. private constructor();
  9. /**
  10. * A human-friendly representation of the exception.
  11. *
  12. * Because many tools simply print `Error.message` directly, this includes not
  13. * only the textual description of what went wrong (the {@link sassMessage})
  14. * but also an indication of where in the Sass stylesheet the error occurred
  15. * (the {@link span}) and the Sass stack trace at the point of error (the
  16. * {@link sassStack}).
  17. */
  18. message: string;
  19. /**
  20. * A textual description of what went wrong.
  21. *
  22. * Unlike {@link message}, this does *not* include representations of {@link
  23. * span} or {@link sassStack}.
  24. */
  25. readonly sassMessage: string;
  26. /**
  27. * A human-friendly representation of the Sass stack trace at the point of
  28. * error.
  29. */
  30. readonly sassStack: string;
  31. /** The location the error occurred in the Sass file that triggered it. */
  32. readonly span: SourceSpan;
  33. /** Returns the same string as {@link message}. */
  34. toString(): string;
  35. }