Exit process with status code 1 when critical error occurs.
Throw error if register device fails.