[Celerity-users] Silencing a specific SEVERE warning from Dojo
Ashley Moran
ashley.moran at patchspace.co.uk
Sat Jul 18 16:18:23 EDT 2009
Hi
I'm being bugged lately by a warning from the Dojo library. The
following script is enough to trigger it, but also generates a few
unrelated warnings:
require 'rubygems'
gem 'jarib-celerity'
require 'celerity'
browser = Celerity::Browser.new
browser.goto("http://dojotoolkit.org/")
The one that is causing a problem is:
SEVERE: runtimeError: message=[document.execCommand(): invalid command
'BackgroundImageCache'] sourceName=[http://dojotoolkit.org/sites/all/modules/dojo/dtk_build/dojo/dojo.js
] line=[20] lineSource=[null] lineOffset=[0]
This is caused by the following code in Dojo (if you use
dojo.js.uncompressed.js):
try{
document.execCommand("BackgroundImageCache", false, true);
}catch(e){
// sane browsers don't have cache "issues"
}
Now, the whole thing is wrapped in an exception block, which means I
wouldn't expect to see any error reporting. (Clearly, it's logging
anyway.) The implication is, I guess, that HtmlUnit is not "sane".
Is there a way round this? Because of the unfortunate SEVERE log
level, we've been forced to disable all JavaScript error reporting, or
suffer this several hundred times during a Cucumber feature run.
Workarounds/other feedback much appreciated.
Thanks
Ashley
--
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashleymoran
http://aviewfromafar.net/
More information about the Celerity-users
mailing list