Use try except instead exists method in PreReceiveShellHook class