Skip to content

Commit f03100f

Browse files
committed
fix(connection): Handle provisioning error
1 parent c1d32f3 commit f03100f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

connection.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@
283283
deviceTokenResponse.access_token
284284
)
285285

286+
if (provisionData.error) {
287+
const error = new Error(provisionData.error)
288+
error.status = 500 //so that catch below works!
289+
throw error
290+
}
291+
286292
$('#device-code').hide()
287293

288294
populateTokenData(deviceTokenResponse)
@@ -302,6 +308,7 @@
302308
if (e.status != 400) {
303309
stopPolling()
304310
$('#device-code').hide()
311+
console.log(e)
305312
showError(e.message)
306313
}
307314
}

0 commit comments

Comments
 (0)