Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netcdf issues can be confusing #2770

Open
dschwoerer opened this issue Oct 13, 2023 · 1 comment
Open

Netcdf issues can be confusing #2770

dschwoerer opened this issue Oct 13, 2023 · 1 comment

Comments

@dschwoerer
Copy link
Contributor

If netcdf fails, it fails often with a generic error.
This is confusing for the user, as it can be, at least some of these issues:

  • File is not available (e.g. file only on login node, not on compute nodes)
  • File is not writable
  • File is locked
  • Path is wrong
  • Folder does not exist (if file is to be created)
  • No permissions to create file in folder

There are probably more, that I cannot think of right now.

It would be nice if

  1. BOUT++ could check which of those issues is the case
  2. BOUT++ could link to some documentation that lists common issues, and how to resolve them.

Obviously 1 would be nicer, but 2 would also be a good start.
Might be worth to push this issue upstream, to throw nicer errors?

@ZedThree
Copy link
Member

Yep, very much agree!

I'd love to push some of this upstream, but their error system can only return a const char*, so they have no opportunity to customise the message. They do have some logging system though, and that could possibly be repurposed/adapted to give better error messages.

When it's an HDF5 error, we might be able to get the HDF5 error stack and parse that ourselves.

Some of this probably can't make it upstream at all, so it would definitely be nice if we handled them. Now we're using C++17, std::filesystem can give us some nice checking for directory existence, creating them if necessary, and so on.

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

No branches or pull requests

2 participants