idea: try/catch and "rethrow"...?

Jason Orendorff jason.orendorff at
Tue Feb 1 11:01:55 PST 2011

On Tue, Feb 1, 2011 at 12:53 PM, Kyle Simpson <getify at> wrote:
> The reason for not wanting to interfere is in the sense of wanting the
> original error to maintain its original execution context (almost like an
> error propagation "stack" if you will), so that when the browser/engine
> reports the uncaught error, it reports it from the correct origination point
> (source file, line-number, etc).

A plain "throw;" statement sounds reasonable enough to me. However,
note that at least in Firefox, the .fileName, .lineNumber, and .stack
properties are set when the Error object is created, not when it is
thrown. So you can rethrow without affecting the context.


More information about the es-discuss mailing list