[W3C SysApps Raw Socket API]: Error handling, exceptions, try - catch

Hi Marcos,

I am currently updating the specification and I have a question on yours and others view on error handling.

After a discussion on error handling with Jonas I came to the following general conclusion:


 *   Use exceptions for synchronous detectable errors in the application code.
 *   Use asynchronous error events with onerror EventHandlers for asynchronous dynamic errors.

When you modified the UDP examples in the Raw Socket API, http://www.w3.org/2012/sysapps/raw-sockets/#interface-udpsocket, you removed the try {..} catch(err) { .. } statements that I had in the code before. I assume that you mean that the application shouldn't handle exceptions and that should be done by the runtime.

However, I am considering to remove the "open" event for UDPSockets as this is not needed. This means that if the UDPSocket constructor runs successfully the application can continue to send datagrams successfully on the socket. So in this case the application needs at least try {..} to assure that the UDPSocket was opened successfully.

Views?

Claes

Claes Nilsson M.Sc.E.E
Master Engineer - Web Research
Advanced Application Labs

Sony Mobile Communications
Tel: +46 705 56 68 78
sonymobile.com<http://sonymobile.com/>

[cid:image001.jpg@01CEBE7D.CD830BB0]

Received on Tuesday, 1 October 2013 07:59:45 UTC