← Back to team overview

launchpad-dev team mailing list archive

Re: javascript errors and ZeroOOPSPolicy

 

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.

(I'm secretly hoping someone else will pick this up and push it forward a bit)


/me waves at all his former partners in awesome

-- 
Martin



Follow ups

References