From 6208754e22f151e0908a2a605be3363ad9abc935 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 22 Jun 2016 12:56:02 +0200 Subject: [PATCH] Better stop error handling --- js/cast.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/cast.js b/js/cast.js index a065013..07ff251 100644 --- a/js/cast.js +++ b/js/cast.js @@ -20,6 +20,11 @@ var castModule = (function () { launchBtn.classList.remove('cast_hidden'); } + function onStopCastError(e) { + onStopCast(); + throw e.description; + } + function updateListener() { if (session.status !== chrome.cast.SessionStatus.CONNECTED) { onStopCast(); @@ -36,7 +41,7 @@ var castModule = (function () { } function stopCast() { - session.stop(onStopCast); + session.stop(onStopCast, onStopCastError); } function onMediaError() {