Re: [presentation-api] Define behavior when sending a message to a PresentationSession fails

I would be in favour of not automatically close and let the web page 
make that decision.

Regarding promise vs. event, I would prefer using a promise because it
 makes it clearer the error is about the message sending and it allows
 different error handling depending on the ```send()``` call. It also 
prevents us from having to pass back the message that was sent and all
 the issues with the type of the message. It comes with a bit `more 
overhead than the event though.

```js
session.onsenderror = function(e) {
  // Note: e.message? e.data? what should we expect the type to be?
  console.error("Was not able to send message '" + e.message + "'");
};
session.send(msg);
```
vs
```js
session.send(msg).catch(function(e) {
  console.error("Was not able to send message '" + msg + "'");  
});
```

If we go with the event, at least, I think we should not use 
```error``` but ```senderror``` for the event name.

-- 
GitHub Notif of comment by mounirlamouri
See 
https://github.com/w3c/presentation-api/issues/149#issuecomment-124166770

Received on Thursday, 23 July 2015 16:56:06 UTC