Added error handler and initial error code ranges