Added generic errorHandler