Better error handling.

Distinguish between "fatal errors" and "expected errors".

Change-Id: ddc2b12e1d