# How best to test for room/stream failures in development

**URL:** <https://discourse.lynckia.com/t/how-best-to-test-for-room-stream-failures-in-development/292>\
**Category:** Uncategorized\
**Created:** [September 16, 2016, 12:21am UTC](https://discourse.lynckia.com/t/how-best-to-test-for-room-stream-failures-in-development/292 "2016-09-16T00:21:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chad\_Phillips](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/chad_phillips/32/27_2.png) [@Chad\_Phillips](https://discourse.lynckia.com/u/Chad_Phillips)\
**Post date:** [September 16, 2016, 12:21am UTC](https://discourse.lynckia.com/t/how-best-to-test-for-room-stream-failures-in-development/292/1 "2016-09-16T00:21:29Z")

</div>

The official recommendation to handle the the various failure scenarios in  
Licode seems to be:

- listen for ‘stream-failed’ events for stream issues
- listen for ‘room-disconnected’ and ‘room-error’ events for room issues
- make sure room.subscribe(), room.unsubscribe(), room.publish(), and  
room.unpublish() use a callback with the signature function(result,  
error){} to look for possible errors in those operations.

My questions are:

- What’s the difference between ‘room-disconnected’ and ‘room-error’?
- Is there an equivalent function(result, error) {} signature that should  
be used for room.connect() and room.disconnect()?
- For development purposes, what have you found to be the easiest way to  
simulate the various failure scenarios for the callbacks and for the  
’stream-failed’, ‘room-error’, and ‘room-disconnected’ events?
