Skip to content

Commit e1e5ef7

Browse files
lade-odooMohammadYounes
authored andcommitted
return an error code when the parsed CSS stdin is invalid
1 parent 46b2fed commit e1e5ef7

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

bin/rtlcss.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,23 @@ function main () {
278278
buffer += data
279279
})
280280
process.on('SIGINT', () => {
281-
processCSSFile(false, buffer)
281+
try {
282+
processCSSFile(false, buffer)
283+
} catch (e) {
284+
currentErrorcode = ErrorCodes.ProcessingError
285+
printError('rtlcss: error processing payload')
286+
printError(e)
287+
}
282288
process.exit()
283289
})
284290
process.stdin.on('end', () => {
285-
processCSSFile(false, buffer)
291+
try {
292+
processCSSFile(false, buffer)
293+
} catch (e) {
294+
currentErrorcode = ErrorCodes.ProcessingError
295+
printError('rtlcss: error processing payload')
296+
printError(e)
297+
}
286298
})
287299
}
288300
}

0 commit comments

Comments
 (0)