← Back to team overview

launchpad-dev team mailing list archive

Re: javascript errors and ZeroOOPSPolicy

 

On 03/23/2011 08:39 PM, Martin Albisetti wrote:
> On Wed, Mar 23, 2011 at 7:48 PM, Robert Collins
> <robertc@xxxxxxxxxxxxxxxxx> wrote:
>> We don't have such tooling today, but perhaps we should treat them
>> with the same severity?
> We're working on something like this in Ubuntu One, although we
> haven't had time to fully work it through.
> The idea is pretty simple, and I picked it up while talking to a gmail
> engineer at a conference. You basically try: except: all your js code,
> and on except, do something nice for the user and hit a URL on the
> server with the js error on the URL. On the other end, you will need
> to parse this and make it sane to look at. You also get, for free, the
> user-agent.
>
> Wrapping all your js code in a try: except: may be hard (although it's
> the only cross-browser way to do it), but there is a simpler way that
> IIRC doesn't work on webkit (it doesn't support window.onerror
> properly), but does on IE and FF. It's just basically adding this to
> the top of all files: https://pastebin.canonical.com/45147/
>
> Paul was poking at making it use YUI instead, so it may evolve. The
> above pastebin does work, though.

The pastebin only works until YUI gets loaded, which then steps on the
onError handler.  I have some work I'd like to finish that will deal
with alerting the user that something went wrong as well as alerting the
user that something has gone wrong.

We do need to do some more work on the endpoint as well, however.

Cheers,
Paul



References