Use different exit codes for different errors

Change-Id: I7e5bba7f290ec9e6c482231bde3c12d13a3a80ea