Webplayer throwing FTP errors as popups

I’m using the WWW class to grab imagery from an ftp server. The ftp server limits the downloads to 5 simultaneously. When I kick off a bunch of requests I handle this gracefully: I have a loop that checks the www progress of each download, and when it detects a 421 error (too many connections) it stops the download, disposes the WWW call, and adds the download to a queue to be restarted when another download finishes. I also catch permanent errors (e.g. file not found) and handle those gracefully.

All of this works perfectly in standalone versions, tested on both Windows and Mac. However, in the webplayer, every time the WWW encounters an ftp error it seems to immediately return it to the browser, which then sends a popup error to the user. The popup is in the following format ([Title:] indicates what’s in the popup titlebar). Each one has a yellow warning icon next to the text.

[Title:]Alert
421 There are too many connections from your internet address.

[Title:]Alert
550 Failed to change directory.

[Title:]Alert
425 failed to establish connection

Since I might kick of 15 of these at a time, I end up spamming the user with 10 popups. Clearly not acceptable.

Any idea how to prevent Unity from sending these to the browser? This is a serious WTF error - why would Unity, a game engine, ever throw an error like this to the browser even if I weren’t handling things gracefully?

Well, as far as i know the www calls work a lot different in the webplayer. Unity does those requests via the browser and doesn’t do the connection itself. I guess it completely depends on the browser you use if such a warning is displayed or not.

So i guess it’s actually the other way round: Not Unity passes the error to the browser, the browser passes the result to unity so i guess there’s not really a way to prevent the browser from doing that when using the WWW component.

It still should be possible to use .NET / Mono to establish the connection and handle the download yourself. Make sure you read the Security Sandbox documentation carefully when you want to try that.