Fix exception catching in ag_data_access