Catches the correct exception in viewer
Fixes error reporting in the viewer