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

The library swallows parsing errors #387

Open
fg-cdd opened this issue Jul 4, 2019 · 0 comments
Open

The library swallows parsing errors #387

fg-cdd opened this issue Jul 4, 2019 · 0 comments

Comments

@fg-cdd
Copy link

fg-cdd commented Jul 4, 2019

Description

When loading a mhd/raw image (probably same with some nifti images) where some metadata is missing in the mhd file, the library just prints the error to the console and swallows it. This is a big problem for applications using the library. Asking the users to check the console is not user friendly. I would like that the errors thrown are bubbled up to the application, so that it can react, for example by:

  • removing the 'Loading …' message
  • showing the error to the user in an application specific way.

Suggested correction

In all 4 places where errors are catched and messages are sent to the console, rethrow the error. The places in the code are were the following appears:

  • window.console.log('oops... something went wrong...');
  • window.console.log('ooops... :(');
    Adding a 'throw error;' is enough in these 4 cases.

How to trigger the error

Load a mhd/raw image where optionnal fields like TransformMatrix or AnatomicalOrientation is missing.

Browsers Affected

All

Versions

  • AMI: v0.32.0
  • THREEJS: r105
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant