Add error handler for splash screen
When some error occurs while parsing the initial bundle, the loading animation stayed there forever.
This MR adds a general JavaScript error handler to show the error page if an error occurs while the splash animation is shown.