Kitware / itk-vtk-viewer

2D / 3D web image, mesh, and point set viewer using itk-wasm and vtk.js
https://kitware.github.io/itk-vtk-viewer/
BSD 3-Clause "New" or "Revised" License
210 stars 64 forks source link

No error reported when check WebGL failed #302

Closed oeway closed 4 years ago

oeway commented 4 years ago

Hi, just noticed createViewer returns null without error. Digging into it and found webGL crashed for some reason, restarting the browser fixes it but it's confusing to get a null return. I think a better behaviour is to throw an error with the actual error message.

https://github.com/Kitware/itk-vtk-viewer/blob/4611de2206e3c97ebdfdf885d6872be63386f509/src/createViewer.js#L43-L45

thewtex commented 4 years ago

@oeway makes sense. Please take a look at https://github.com/Kitware/itk-vtk-viewer/pull/305