Made errorHandler injectable rather than built in