Currently, the fallback loader in NXobject catches (nearly) all exceptions from loaders for concrete classes and uses the fallback. This is intended to allow loading files with partially bad structure. But it also hides user errors like a bad index (wrong dim, bad slice, etc.).
We should distinguish between errors originating in the file structure and error originating from the user/caller. Only the former should trigger the fallback.
We are already making use of scippnexus.NexusStructureError in a number of places. Structure errors are exactly what the fallback is about, so maybe we can use that more consistently?
Currently, the fallback loader in
NXobject
catches (nearly) all exceptions from loaders for concrete classes and uses the fallback. This is intended to allow loading files with partially bad structure. But it also hides user errors like a bad index (wrong dim, bad slice, etc.).We should distinguish between errors originating in the file structure and error originating from the user/caller. Only the former should trigger the fallback.