Skip to content

Commit

Permalink
add stacktrace on bad crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
bbohec committed Jul 7, 2023
1 parent 21ab02a commit e2c2e80
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions shared/src/tokens/token.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,14 @@ export const createEstablishmentMagicLinkPayload = ({
};
};

export const stringToMd5 = (str: string) =>
crypto.createHash("md5").update(str).digest("hex");
export const stringToMd5 = (str: string) => {
try {
return crypto.createHash("md5").update(str).digest("hex");
} catch (error) {
Error.captureStackTrace(error as Error);
throw error;
}
};

export type CreateConventionMagicLinkPayloadProperties = {
id: ConventionId;
Expand Down

0 comments on commit e2c2e80

Please sign in to comment.