Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

Add error/completion handlers for sessions, publishers, subscribers #10

Merged
merged 5 commits into from
Mar 25, 2017

Conversation

aiham
Copy link
Contributor

@aiham aiham commented Mar 24, 2017

Resolves #7

  • Adds onError and onConnect to OTSession
  • Adds onError and onConnect to createSession
  • Adds onError, onInit and onPublish to OTPublisher
  • Adds onError and onSubscribe to OTSubscriber
  • Updates example app to display connect, publish and subscribe errors

@aiham
Copy link
Contributor Author

aiham commented Mar 24, 2017

@Fofir I decided against differentiating between errors from init and publish as implemented in #8 because I don't think you should design your error handling logic based on which stage of the component failed. Actually with your design if you listen to both error handlers and publish is called immediately after initialising the publisher then its possible to get the same error returned via both callbacks. Even a getUserMedia error can be sent through the publish callback. I've made it so only the first callback with an error will bubble up through onError

@Fofir
Copy link

Fofir commented Mar 25, 2017

@aiham looks cool to me and makes a lot of sense

@aiham aiham merged commit 93941b6 into dev Mar 25, 2017
@aiham aiham deleted the feat/error-handlers branch March 25, 2017 20:40
@aiham aiham mentioned this pull request Mar 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants