diff --git a/packages/connect-react/src/contexts/AppendProcessProvider.tsx b/packages/connect-react/src/contexts/AppendProcessProvider.tsx index e86dcb48..6ffc0a60 100644 --- a/packages/connect-react/src/contexts/AppendProcessProvider.tsx +++ b/packages/connect-react/src/contexts/AppendProcessProvider.tsx @@ -29,10 +29,11 @@ export const AppendProcessProvider: FC> = ({ children, const handleErrorSoft = useCallback( async (situationCode: AppendSituationCode, expected: boolean, showError: boolean, error?: ConnectError) => { + const messageCode = `situation: ${situationCode} ${error?.track()}`; if (expected) { - await getConnectService().recordEventAppendError(); + await getConnectService().recordEventAppendError(messageCode); } else { - await getConnectService().recordEventAppendErrorUnexpected(`situation: ${situationCode} ${error?.track()}`); + await getConnectService().recordEventAppendErrorUnexpected(messageCode); } if (showError) { @@ -44,10 +45,11 @@ export const AppendProcessProvider: FC> = ({ children, const handleErrorHard = useCallback( async (situationCode: AppendSituationCode, expected: boolean, error?: ConnectError) => { + const messageCode = `situation: ${situationCode} ${error?.track()}`; if (expected) { - await getConnectService().recordEventAppendError(); + await getConnectService().recordEventAppendError(messageCode); } else { - await getConnectService().recordEventAppendErrorUnexpected(`situation: ${situationCode} ${error?.track()}`); + await getConnectService().recordEventAppendErrorUnexpected(messageCode); } config.onError?.(situationCode.toString()); diff --git a/packages/web-core/src/services/ConnectService.ts b/packages/web-core/src/services/ConnectService.ts index be285bf7..f17443bc 100644 --- a/packages/web-core/src/services/ConnectService.ts +++ b/packages/web-core/src/services/ConnectService.ts @@ -660,8 +660,8 @@ export class ConnectService { return this.#recordEvent(PasskeyEventType.AppendCredentialExists, messageCode, challenge); } - recordEventAppendError() { - return this.#recordEvent(PasskeyEventType.AppendError); + recordEventAppendError(messageCode?: string) { + return this.#recordEvent(PasskeyEventType.AppendError, messageCode); } recordEventLoginErrorUnexpected(messageCode: string) {