@signalwire/js 4.0.0-dev-20260911205444 → 4.0.0-dev-20260914173015

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.mjs CHANGED
@@ -17574,16 +17574,12 @@ var WebRTCVertoManager = class extends VertoManager {
17574
17574
  const webrtcVertoMessage = WebrtcVerto(params);
17575
17575
  const response = await this.webRtcCallSession.execute(webrtcVertoMessage);
17576
17576
  const nonFatal = message.method === "verto.info" ? { fatal: false } : void 0;
17577
- if (response.error) {
17578
- const error = new JSONRPCError(response.error.code, response.error.message, response.error.data);
17579
- this.reportLegError(error, this._rtcPeerConnectionsMap.get(params.callID), nonFatal);
17580
- return response;
17581
- }
17582
17577
  const innerResult = getValueFrom(response, "result.result");
17583
- if (innerResult?.error) {
17584
- const error = new JSONRPCError(innerResult.error.code, innerResult.error.message, innerResult.error.data);
17578
+ const failure = response.error ?? innerResult?.error;
17579
+ if (failure) {
17580
+ const error = new JSONRPCError(failure.code, failure.message, failure.data);
17581
+ if (message.method === "verto.invite") throw error;
17585
17582
  this.reportLegError(error, this._rtcPeerConnectionsMap.get(params.callID), nonFatal);
17586
- return response;
17587
17583
  }
17588
17584
  return response;
17589
17585
  }
@@ -17638,7 +17634,7 @@ var WebRTCVertoManager = class extends VertoManager {
17638
17634
  if (rtcPeerConnController.isMainDevice) this._signalingStatus$.next(status);
17639
17635
  }
17640
17636
  processInviteResponse(response, rtcPeerConnController) {
17641
- if (!response.error && getValueFrom(response, "result.result.result.message") === "CALL CREATED") {
17637
+ if (getValueFrom(response, "result.result.result.message") === "CALL CREATED") {
17642
17638
  this.emitMainSignalingStatus(rtcPeerConnController.id, "trying");
17643
17639
  const nodeId = getValueFrom(response, "result.node_id") ?? null;
17644
17640
  const memberId = getValueFrom(response, "result.result.result.memberID") ?? null;
@@ -17665,8 +17661,7 @@ var WebRTCVertoManager = class extends VertoManager {
17665
17661
  logger$16.debug(`[WebRTCManager] nodeid: ${this._nodeId$.value}, selfId: ${this._selfId$.value}`);
17666
17662
  } else {
17667
17663
  logger$16.error("[WebRTCManager] Verto invite failed:", response);
17668
- const inviteError = response.error ? new JSONRPCError(response.error.code, response.error.message, response.error.data) : /* @__PURE__ */ new Error("Verto invite failed: unexpected response");
17669
- this.reportLegError(inviteError, rtcPeerConnController);
17664
+ this.reportLegError(/* @__PURE__ */ new Error("Verto invite failed: unexpected response"), rtcPeerConnController);
17670
17665
  }
17671
17666
  }
17672
17667
  get RTCPeerConnectionConfig() {