Skip to content

Commit

Permalink
chore: update getTemplateURL error message
Browse files Browse the repository at this point in the history
  • Loading branch information
HJunyuan committed Sep 6, 2023
1 parent 4f9cb7b commit 522bf59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/shared/utils/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ describe("Util Functions", () => {
},
};
expect(() => utils.getTemplateURL(document)).toThrow(
new Error("Unsupported document type: Only can retrieve template url from OpenAttestation v2 & v3 documents.")
new Error(
"Unsupported document type: Only can retrieve template url from OpenAttestation v2, v3 & v4 documents."
)
);
});
});
Expand Down
4 changes: 3 additions & 1 deletion src/shared/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ export const getTemplateURL = (document: any): string | undefined => {
return document.renderMethod?.url;
}

throw new Error("Unsupported document type: Only can retrieve template url from OpenAttestation v2 & v3 documents.");
throw new Error(
"Unsupported document type: Only can retrieve template url from OpenAttestation v2, v3 & v4 documents."
);
};

export const getDocumentData = (document: WrappedDocument<OpenAttestationDocument>): OpenAttestationDocument => {
Expand Down

0 comments on commit 522bf59

Please sign in to comment.