Extracted try/catch.