added error levels to custom error handler