Moving try/except block for testing.