Skip to content

Commit

Permalink
feat: catching errors from claim validator refreshes (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus authored Sep 16, 2022
1 parent e6ab890 commit fbaaf6e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 18 deletions.
2 changes: 1 addition & 1 deletion bundle/bundle.js

Large diffs are not rendered by default.

44 changes: 28 additions & 16 deletions lib/build/recipeImplementation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion lib/ts/recipeImplementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ export default function RecipeImplementation(recipeImplInput: {

for (const validator of input.claimValidators) {
if (await validator.shouldRefresh(accessTokenPayload, input.userContext)) {
await validator.refresh(input.userContext);
try {
await validator.refresh(input.userContext);
} catch (err) {
console.error(`Encountered an error while refreshing validator ${validator.id}`, err);
}
accessTokenPayload = await this.getAccessTokenPayloadSecurely({ userContext: input.userContext });
}
}
Expand Down

0 comments on commit fbaaf6e

Please sign in to comment.