catchsecurity exceptions when checking permissions or paths