Catch exceptions when running activities