I meant "git repository error" is not exact for this case.

If your function checks it is a git repository or not, why not just show "not a git repository"? It is clearer to user.