Skip to content

Better Exception Handling in API functions #690

Description

@philipc2

Proposed new feature or change:

We should avoid using these general try/catch blocks and instead keep the original exception. Applies to open_grid, open_dataset, and open_mfdataset

else:
try:
grid_ds = xr.open_dataset(
grid_filename_or_obj, decode_times=False, **kwargs
)
uxgrid = Grid.from_dataset(grid_ds, use_dual=use_dual)
except ValueError:
raise ValueError("Inputted grid_filename_or_obj not supported.")
return uxgrid

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    improvementImprovements on existing features or infrastructure

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions