[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Null return values on context loss



On Wed, Nov 16, 2011 at 1:41 AM, Cedric Vivier <cvivier@mozilla.com> wrote:
Hmm, for this particular case, isn't this just trading an exception
for another afaics?
If you prefer not to have null checks, you could catch the null
reference exception (ie. TypeError).

No, because that's the wrong exception. TypeError is an exception indicating programming errors; if you catch that then you're going to mask real programming errors in addition to the error condition you're actually trying to catch.

--
Glenn Maynard