atom feed1 message in com.googlegroups.prototype-coreRe: [Prototype-core] Javascript error...
FromSent OnAttachments
Samuel LebeauAug 25, 2009 8:49 pm 
Subject:Re: [Prototype-core] Javascript errors in Ajax callbacks are not being reported to console.
From:Samuel Lebeau ("sam@gmail.com)
Date:Aug 25, 2009 8:49:47 pm
List:com.googlegroups.prototype-core

Hi Luisgo,

From what I remember you're absolutely right and this could be quite annoying when debugging an application. Ajax API provides a `onException` callback/responder but exception is silently ignored when none is provided. [1]

I guess a less-surprising behavior would be to re-throw exception in that case, but unfortunately current `Ajax.Responders` implementation doesn't allow to know if there is such a registered responder. Furthermore, testing this behavior will only be possible on platforms that allow catching exceptions globally (`window.onerror`...).

Sounds like it definitely needs discussion...

BTW, It looks like, due to this try/catch statement, exception thrown within an `onException` callback will be silently ignored too... [2] Can someone confirm this?

[1] http://prototypejs.org/api/ajax/options [2]
http://github.com/sstephenson/prototype/blob/f405b2c510e09b55d08c926a9e1a5c2e2d0a1834/src/ajax/responders.js#L108

Best, Samuel.

On 18 juin 09, at 23:48, Luisgo wrote:

I realize this may not be a prototype-specific problem but I only use prototype and have not seen this anywhere else.

Whenever something breaks inside an ajax callback, errors die silently without reporting at all. I thought the problem could be in firebug but errors are not being reported to the firefox error console either.

Is this something in prototype or am I completely off?

Sorry if this is not the appropriate place to ask.

Thanks.