Open effigies opened 1 month ago
@effigies, would you prefer throw new Error('That file does not appear to be NIFTI!')
? I think it is definitely helpful to tell the user something doesn't look correct. I have personally found this useful in Niivue.
I'm perfectly happy with null
, but I can catch an error, too.
https://github.com/rii-mango/NIFTI-Reader-JS/blob/0e406b03775d5687911f9440dffa65d7b0886137/src/nifti.ts#L143-L145
It's not ideal to have
console.error
obligatorily called by a library, as it pollutes my output. I'm going to handle a null return value myself. Would it be possible to either remove the call or make it possible to turn off?In the short term, I'm just wrapping: