diff --git a/src/queue/consumers/oneidentity/consumerCallbacks/syncVisitToOneIdentityHandler.spec.ts b/src/queue/consumers/oneidentity/consumerCallbacks/syncVisitToOneIdentityHandler.spec.ts index 34219cd..8d82769 100644 --- a/src/queue/consumers/oneidentity/consumerCallbacks/syncVisitToOneIdentityHandler.spec.ts +++ b/src/queue/consumers/oneidentity/consumerCallbacks/syncVisitToOneIdentityHandler.spec.ts @@ -582,7 +582,9 @@ describe('syncVisitToOneIdentityHandler', () => { await expect( syncVisitToOneIdentityHandler(visitMessage, Event.VISIT_DELETED) - ).rejects.toThrow('Person not found in One Identity'); + ).rejects.toThrow( + 'Person with central account "visitor-oidc-sub" not found in One Identity' + ); expect(mockOneIdentity.login).toHaveBeenCalled(); expect(mockOneIdentity.getPerson).toHaveBeenCalledWith( @@ -998,7 +1000,9 @@ describe('syncVisitToOneIdentityHandler', () => { await expect( syncVisitToOneIdentityHandler(visitMessage, Event.VISIT_UPDATED) - ).rejects.toThrow('Person not found in One Identity'); + ).rejects.toThrow( + 'Person with central account "visitor-oidc-sub" not found in One Identity' + ); expect(mockOneIdentity.login).toHaveBeenCalled(); expect(mockOneIdentity.getPerson).toHaveBeenCalledWith( diff --git a/src/queue/consumers/oneidentity/consumerCallbacks/syncVisitToOneIdentityHandler.ts b/src/queue/consumers/oneidentity/consumerCallbacks/syncVisitToOneIdentityHandler.ts index 8fb9599..add0ad9 100644 --- a/src/queue/consumers/oneidentity/consumerCallbacks/syncVisitToOneIdentityHandler.ts +++ b/src/queue/consumers/oneidentity/consumerCallbacks/syncVisitToOneIdentityHandler.ts @@ -93,7 +93,9 @@ async function getScienceUser( const person = await oneIdentity.getPerson(centralAccount); if (!person) { - throw new Error('Person not found in One Identity'); + throw new Error( + `Person with central account "${centralAccount}" not found in One Identity` + ); } if (person.CCC_EmployeeSubType === IdentityType.ESSSCIENCEUSER)