catch exception for git handles