error handling for pre-commit hooks