python-neo icon indicating copy to clipboard operation
python-neo copied to clipboard

Better error message upon failure in loading `OpenEphysBinary` folder

Open alejoe91 opened this issue 1 year ago • 5 comments

Something I've been wanting to do for a long time :)

alejoe91 avatar Jan 31 '24 16:01 alejoe91

I think I am clearly not agree with this. This big try except is not good design. We need to put try except on very targeted places that focus on a clear failure that could happen.

samuelgarcia avatar Feb 01 '24 08:02 samuelgarcia

Better than before at least. I agree that long term we need a better handling, but I'm not sure when I'll have time for it

alejoe91 avatar Feb 01 '24 08:02 alejoe91

I also agree more targeted would be better, but at least what I see from the tracker the usual flow is this.

I have an error with openephysbinary (gives error) That's probably related to folder structure could you list the files.

With this error you tell them that it is likely the folder structure to begin with. Maybe a comment to say in the future improve to more specific/more helpful errors (ie this file was not found--I don't know openephy very well so I'm not sure what the structure would really need to be).

zm711 avatar Feb 01 '24 10:02 zm711

At least lets do the try in the other part:

try:
    explore_folder(dirname, experiment_names=None)
except:
   ...

No ?

samuelgarcia avatar Feb 02 '24 10:02 samuelgarcia

At least lets do the try in the other part:

try:
    explore_folder(dirname, experiment_names=None)
except:
   ...

No ?

The second part of the explore_folder already throws an interpretable errror about not finding any structure.oebin files. Only the first part tends to fail with un-interpretable errors

alejoe91 avatar Feb 02 '24 11:02 alejoe91