Skip to content

Commit 8bce587

Browse files
committed
fix: adjust signal abort error messages across useSession / useAgent to make them consistent
1 parent b3daaa0 commit 8bce587

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/react/src/hooks/useAgent.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ function useAgentWaitUntilAvailable(emitter: TypedEventEmitter<AgentCallbacks>,
267267
};
268268
const abortHandler = () => {
269269
cleanup();
270-
reject(new Error('useAgent.waitUntilAvailable - signal aborted'));
270+
reject(new Error('useAgent(/* ... */).waitUntilAvailable - signal aborted'));
271271
};
272272

273273
const cleanup = () => {
@@ -594,7 +594,7 @@ export function useAgent(session?: SessionStub): UseAgentReturn {
594594
};
595595
const abortHandler = () => {
596596
cleanup();
597-
reject(new Error('useAgent.waitUntilCamera - signal aborted'));
597+
reject(new Error('useAgent(/* ... */).waitUntilCamera - signal aborted'));
598598
};
599599

600600
const cleanup = () => {
@@ -621,7 +621,7 @@ export function useAgent(session?: SessionStub): UseAgentReturn {
621621
};
622622
const abortHandler = () => {
623623
cleanup();
624-
reject(new Error('useAgent.waitUntilMicrophone - signal aborted'));
624+
reject(new Error('useAgent(/* ... */).waitUntilMicrophone - signal aborted'));
625625
};
626626

627627
const cleanup = () => {

packages/react/src/hooks/useSession.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,11 @@ function useSessionWaitUntilConnectionState(
215215
};
216216
const abortHandler = () => {
217217
cleanup();
218-
reject(new Error(`AgentSession.waitUntilRoomState(${state}, ...) - signal aborted`));
218+
reject(
219+
new Error(
220+
`useSession(/* ... */).waitUntilConnectionState(${state}, /* signal */) - signal aborted`,
221+
),
222+
);
219223
};
220224

221225
const cleanup = () => {

0 commit comments

Comments
 (0)