A fix for the e2e issue which restores the use of a catch block

This commit is contained in:
Mark J
2025-05-09 10:17:03 +00:00
committed by setop
parent afe418b211
commit bfd6d0ada1
2 changed files with 14 additions and 3 deletions

View File

@@ -38,7 +38,8 @@ export async function changeIdentity(identity: IPerson): Promise<void> {
* the current identity used
*/
export async function initializeCurrentActor(
identities: IPerson[] | undefined
identities: IPerson[] | undefined,
rethrow = false
): Promise<void> {
const actorId = localStorage.getItem(AUTH_USER_ACTOR_ID);
console.debug("Initializing current actor", actorId);
@@ -62,6 +63,10 @@ export async function initializeCurrentActor(
await changeIdentity(activeIdentity);
}
} catch (e) {
console.error("Failed to initialize current Actor", e);
if (rethrow) {
throw e;
} else {
console.error("Failed to initialize current Actor", e);
}
}
}