RelaxedJS/ReLaXed

Exit code is 0 despite failure to create PDF

iJebus opened this issue · 0 comments

In some cases, when there is a failure in creating a PDF, relaxed exits with 0 instead of 1. Example below.

> relaxed INC0010040.pug --build-once                                                                                                                                                          
Launching ReLaXed...

Processing /INC0010040.pug...
ENOENT: no such file or directory, open '/x/style.scss'
    at /x/INC0010040.pug line 46
There was a Pug error (see above)
... Done in 0.21s

> echo $?                                                                                                                                                                                              
0

I'm in two minds about this. It makes sense to me in that there wasn't an error with relaxed itself; as the message says it's an error with my pug template. On the other hand, relaxed creates PDF files and a failure to do so is an error all the same. I'm guessing this relates back to when relaxed is running without the --build-once flag and the program continues running with there is an error in a pug template.

It's a pretty easy workaround in that I'll just do some matching on the output to check for errors, but I'm interested in others thoughts on this.