Skip to content

Commit

Permalink
return an error code when the parsed CSS stdin is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
lade-odoo committed Aug 26, 2024
1 parent 46b2fed commit a7cc308
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions bin/rtlcss.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,23 @@ function main () {
buffer += data
})
process.on('SIGINT', () => {
processCSSFile(false, buffer)
try {
processCSSFile(false, buffer)
} catch (e) {
currentErrorcode = ErrorCodes.ProcessingError
printError(`rtlcss: error processing payload`)
printError(e)
}
process.exit()
})
process.stdin.on('end', () => {
processCSSFile(false, buffer)
try {
processCSSFile(false, buffer)
} catch (e) {
currentErrorcode = ErrorCodes.ProcessingError
printError(`rtlcss: error processing payload`)
printError(e)
}
})
}
}
Expand Down

0 comments on commit a7cc308

Please sign in to comment.