Prototype callback functions swallowing exceptions

旧街凉风 提交于 2019-11-30 22:06:12

As of today, this is known behaviour:

http://groups.google.com/group/prototype-scriptaculous/browse_thread/thread/e71c7a6bfb656380/7d1c8a23edc07f03?lnk=gst&q=exception+swallowed#

There is a ticket in for an enhancement to deal with these swallowed exceptions here:

https://prototype.lighthouseapp.com/projects/8886/tickets/634-no-exception-on-error-in-oncreate-method-of-ajaxrequest

One work-around suggested is to add the following code (thanks Glenn Maynard!):

Ajax.Responders.register({ 
        onException: function(request, exception) { 
                (function() { throw exception; }).defer(); 
        } 
});

Hope that helps others with the same issue until a more permanent solution is implemented.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!