8

I am updating a site that I've built for the Nintendo Wii, and am looking for a good way to debug the application. Wii's browser (a version of Opera 9.3) does not have any sort of JavaScript console. I was going to use one of the various remote debug console solutions (such as jsconsole.com), but none of them seem to work. I suspect the reason for this is some sort of unsupported functionality, but I cannot figure out what that is without a console or some sort of error output.

Things I've tried:

  1. window.onerror (Not supported until Opera 11.6)
  2. Overriding the Error.prototype.toString method (works on desktops, not on Wii)
  3. Code that appears to wrap script in try/catch blocks (Exceptions aren't thrown for reference errors and what not. try/catch works, but only for exceptions I throw.)
  4. <body onerror="alert('ERROR!!!')" />
  5. PhoneGap's Remote Debugger / Weinre

Are there any other suggestions for catching errors and unhandled exceptions for an entire page?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Brad
  • 159,648
  • 54
  • 349
  • 530
  • "(I imagine this isn't working since it will only catch exceptions, and not runtim errors?)" - what do you mean by runtime error? On Chrome it catches everything I could think of except syntax errors. – millimoose Sep 30 '12 at 19:52
  • @millimoose, Good point, I hadn't thought that through. There isn't a syntax error in the code from jsconsole.com... so I wonder why the try/catch approach doesn't work? I will look into it some more. – Brad Sep 30 '12 at 19:56
  • have you tried PhoneGap's remote debugging script? http://debug.phonegap.com/ just include the script tag into your html and check to see if there are errors. You can also use the console tab to interact with your site. – Tony Sep 30 '12 at 20:05
  • @Tony, I wasn't able to get PhoneGap's debugger to work, but I think it's because some of their scripts aren't loading at the moment. In any case, it looks like they are using Weinre, so I downloaded that and gave it a try from my server... no luck. It works on a desktop, but on the Wii, it never appears as a target. – Brad Sep 30 '12 at 22:59
  • I'm sorry it didn't work out, didn't want to waste your time. On another note, I always thought that developing for iOS devices is difficult because of Apple's wall garden. I think comparing to what you are going through to get your Wii app up and running, developing for iOS devices is pretty much easy. – Tony Oct 01 '12 at 10:09
  • 2
    Out of curiosity, have you tried a simple (though an incredibly tedious method of debugging) using [`try { // do stuff } catch (err) { document.getElementById('output').textContent = err; }`](http://jsfiddle.net/davidThomas/h8qJd/)? I assume you have (and, as noted, if you haven't then I can't imagine it would speed up your work-flow, but might help a little...). – David Thomas Oct 01 '12 at 14:47
  • Does some generic try..catch block (which you would put on separate page to avoid other script interfere) work ever? Or you just can't seem to use try..catch blocks on Wii at all? – WTK Oct 08 '12 at 13:31
  • A `try/catch` block does work, but it seems that exceptions are not being thrown. If I throw my own exception, I can catch it, but things like null reference exceptions aren't thrown. – Brad Nov 04 '12 at 00:09

2 Answers2

1

this link was suggestting lookimng into firebug lite. I don't know how it would fare on the wii browser as I don't own the device.

It's a pity that the engine is too old for supporting draagonfly.

Community
  • 1
  • 1
dvhh
  • 4,724
  • 27
  • 33
  • Thanks, Firebug Lite has loaded successfully on the Wii! I don't know if I can get anything to show up in its console, but at least I have a way to poke around a bit and see if I can narrow down the issue. – Brad Nov 04 '12 at 00:48
1

You could always program in the debugging code yourself, for instance:

try{
    yourFunction();
}catch(e){
    alert('yourFunction failed!');
}
  • This doesn't work, as I have said in my question. I need to catch errors for the whole page, not just a single block. In any case, I've found that the browser isn't actually throwing exceptions, which is why I am unable to catch them. – Brad Nov 04 '12 at 00:10