f4d4c25025812826e554564e31946d131cbb69cbd6ca8d8532cb31cd9ef5941915793f78ab39a85fff9e068a2b619f25fadd2e39d0829a2cac2a8fa5ce2a3e 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * The exception type thrown by {@link renderSync} and passed as the error to
  3. * {@link render}'s callback.
  4. *
  5. * @category Legacy
  6. * @deprecated This is only thrown by the legacy {@link render} and {@link
  7. * renderSync} APIs. Use {@link compile}, {@link compileString}, {@link
  8. * compileAsync}, and {@link compileStringAsync} instead.
  9. */
  10. export interface LegacyException extends Error {
  11. /**
  12. * The error message. For Dart Sass, when possible this includes a highlighted
  13. * indication of where in the source file the error occurred as well as the
  14. * Sass stack trace.
  15. */
  16. message: string;
  17. /**
  18. * The error message. For Dart Sass, this is the same as the result of calling
  19. * {@link toString}, which is itself the same as {@link message} but with the
  20. * prefix "Error:".
  21. */
  22. formatted: string;
  23. /**
  24. * The (1-based) line number on which the error occurred, if this exception is
  25. * associated with a specific Sass file location.
  26. */
  27. line?: number;
  28. /**
  29. * The (1-based) column number within {@link line} at which the error
  30. * occurred, if this exception is associated with a specific Sass file
  31. * location.
  32. */
  33. column?: number;
  34. /**
  35. * Analogous to the exit code for an executable. `1` for an error caused by a
  36. * Sass file, `3` for any other type of error.
  37. */
  38. status: number;
  39. /**
  40. * If this exception was caused by an error in a Sass file, this will
  41. * represent the Sass file's location. It can be in one of three formats:
  42. *
  43. * * If the Sass file was loaded from disk, this is the path to that file.
  44. * * If the Sass file was generated by an importer, this is its canonical URL.
  45. * * If the Sass file was passed as {@link LegacyStringOptions.data} without a
  46. * corresponding {@link LegacyStringOptions.file}, this is the special
  47. * string `"stdin"`.
  48. */
  49. file?: string;
  50. }