patching in a try/catch with warnings