Skip to content

Commit

Permalink
Improve error message when creating sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
third774 committed Sep 16, 2024
1 parent 4629ad5 commit bf5d576
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/utils/rxjs/RxjsPeer.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,13 @@ export class RxjsPeer {
if (response.status > 400) {
throw new Error('Error creating Calls session')
}
const { sessionId } = (await response.json()) as any
return { peerConnection, sessionId }

try {
const { sessionId } = (await response.clone().json()) as any
return { peerConnection, sessionId }
} catch (error) {
throw new Error(response.status + ': ' + (await response.text()))
}
}

async fetchWithRecordedHistory(path: string, requestInit?: RequestInit) {
Expand Down

0 comments on commit bf5d576

Please sign in to comment.