Error type included in error message for internal errors.
Guarded against null pointer exceptions.