UNPKG

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