Skip to content

Commit

Permalink
fix: better logging when live streams are blocked by modes settings
Browse files Browse the repository at this point in the history
  • Loading branch information
dgreif committed Aug 3, 2020
1 parent 15d2ace commit ae809f5
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions api/ring-camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,20 @@ export class RingCamera extends Subscribed {
}

startVideoOnDemand() {
return this.restClient.request<ActiveDing | ''>({
method: 'POST',
url: this.doorbotUrl('live_view'), // Ring app uses vod for battery cams, but doesn't appear to be necessary
})
return this.restClient
.request<ActiveDing | ''>({
method: 'POST',
url: this.doorbotUrl('live_view'), // Ring app uses vod for battery cams, but doesn't appear to be necessary
})
.catch((e) => {
if (e.response?.statusCode === 403) {
const errorMessage = `Camera ${this.name} returned 403 when starting a live stream. This usually indicates that live streaming is blocked by Modes settings. Check your Ring app and verify that you are able to stream from this camera with the current Modes settings.`
logError(errorMessage)
throw new Error(errorMessage)
}

throw e
})
}

private pollForActiveDing() {
Expand Down

0 comments on commit ae809f5

Please sign in to comment.