@@ -56,13 +56,23 @@ result.map // source map object
5656
5757### Errors
5858
59- Errors will have ` error.position ` , just like [ ` node.position ` ] ( #position ) . The
60- error contains the source position in the message. To get the error message
61- without the position use ` error.reason ` .
59+ Errors thrown during parsing have the following properties:
60+
61+ - message: ` String ` . The full error message with the source position.
62+ - reason: ` String ` . The error message without position.
63+ - filename: ` String ` or ` undefined ` . The value of ` options.source ` if
64+ passed to ` css.parse ` . Otherwise ` undefined ` .
65+ - line: ` Integer ` .
66+ - column: ` Integer ` .
67+ - source: ` String ` . The portion of code that couldn't be parsed.
68+
69+ When parsing with the ` silent ` option, errors are listed in the
70+ ` parsingErrors ` property of the [ ` stylesheet ` ] ( #stylesheet ) node instead
71+ of being thrown.
6272
6373If you create any errors in plugins such as in
64- [ rework] ( https://github.com/reworkcss/rework ) , you __ must__ set the ` position `
65- as well for consistency.
74+ [ rework] ( https://github.com/reworkcss/rework ) , you __ must__ set the same
75+ properties for consistency.
6676
6777## AST
6878
@@ -114,6 +124,8 @@ The root node returned by `css.parse`.
114124- stylesheet: ` Object ` :
115125 - rules: ` Array ` of nodes with the types ` rule ` , ` comment ` and any of the
116126 at-rule types.
127+ - parsingErrors: ` Array ` of ` Error ` s. Errors collected during parsing when
128+ option ` silent ` is true.
117129
118130#### rule
119131
0 commit comments