# Why does lualatex return with exit code 1 even though a PDF was built?

Using TeXLive 2011, I invoke lualatex on a TeX file from the command line. The PDF builds (mostly correctly, although the source TeX file has many many errors and warnings, none fatal). However, the exit code (%ERRORLEVEL%) is set to 1, which is normally used to indicate an error. Why does this happen?

-
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. –  Werner Nov 9 '11 at 16:55
This is perfectly normal, when errors are encountered during compilation. –  egreg Nov 9 '11 at 16:56
The output is started before all processing is complete. It is a common data processing pattern, and the presence of an output file does not imply success. –  Andrey Vihrov Nov 9 '11 at 17:21
Only warnings, such as "Overfull \hbox" or similar ones, make the exit status to be 0.