tidepool-org/blip — pull request #82 by nicolashery (2014-05-22 11:54:09+00:00)
Title: Add basic JS runtime error notification

This adds a notification if a JavaScript runtime error would to occur.

Note that, unlike a **backend API error** (https://github.com/tidepool-org/blip/pull/81), a **JS runtime error** means that the app "crashed" somehow. In the case of a **backend API error**, the client-side should most of the time be able to recover and continue working (i.e. you can still click around). In the case of the **JS runtime error** however, I expect that there won't be much you can do other than close/refresh the window and maybe try again.

The error notification is very simple, and completely separate from the app code (which is the thing that crashes). It's really there to let the user know something unexpected happen, so she's not guessing (you could be staring at a blank screen). These errors hopefully will be extremely rare. If we do get some, it probably means we should have a better test coverage.

If you want to try it out, put something silly in the code somewhere (ex: in the `render()` function of the `Login` page):

```javascript
var a;
console.log(a.length);
```

@jebeck: A while ago, Tideline would have SVG errors when not enough data (like trying to plot lines with `NaN`). Is that still the case? Because that might trigger this notification (not 100% sure as it's a rendering error not a JS one it seems)...

![screen shot 2014-05-22 at 1 36 36 pm](https://cloud.githubusercontent.com/assets/1306536/3053299/5f39515c-e1a7-11e3-80a7-541338a4faf0.png)