5
5
use Sabberworm \CSS \CSSList \CSSList ;
6
6
use Sabberworm \CSS \CSSList \Document ;
7
7
use Sabberworm \CSS \CSSList \KeyFrame ;
8
+ use Sabberworm \CSS \Parsing \SourceException ;
8
9
use Sabberworm \CSS \Property \AtRule ;
9
10
use Sabberworm \CSS \Property \Import ;
10
11
use Sabberworm \CSS \Property \Charset ;
@@ -100,7 +101,7 @@ private function parseList(CSSList $oList, $bIsRoot = false) {
100
101
$ this ->consumeWhiteSpace ();
101
102
}
102
103
if (!$ bIsRoot ) {
103
- throw new \ Exception ("Unexpected end of document " );
104
+ throw new SourceException ("Unexpected end of document " , $ this -> iLineNo );
104
105
}
105
106
}
106
107
@@ -120,7 +121,7 @@ private function parseListItem(CSSList $oList, $bIsRoot = false) {
120
121
} else if ($ this ->comes ('} ' )) {
121
122
$ this ->consume ('} ' );
122
123
if ($ bIsRoot ) {
123
- throw new \ Exception ("Unopened { " );
124
+ throw new SourceException ("Unopened { " , $ this -> iLineNo );
124
125
} else {
125
126
return null ;
126
127
}
@@ -235,7 +236,7 @@ private function parseStringValue() {
235
236
while (!$ this ->comes ($ sQuote )) {
236
237
$ sContent = $ this ->parseCharacter (false );
237
238
if ($ sContent === null ) {
238
- throw new \Exception ("Non-well-formed quoted string {$ this ->peek (3 )}" );
239
+ throw new \Exception ("Non-well-formed quoted string {$ this ->peek (3 )}" , $ this -> iLineNo );
239
240
}
240
241
$ sResult .= $ sContent ;
241
242
}
0 commit comments