Skip to content

Commit

Permalink
Handle error for function getZip
Browse files Browse the repository at this point in the history
Co-authored-by: Caroline Conchon <[email protected]>
  • Loading branch information
carolineconchon and Caroline Conchon authored Nov 27, 2023
1 parent ec90093 commit b8ddcf9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions es6/tests/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,12 @@ function createDocV4(name, options) {
}

function getZip(name) {
if (
documentCache[name] === undefined ||
documentCache[name].loadedContent === undefined
) {
throw new Error("the file examples/" + name + " doesn't exist");
}
return new PizZip(documentCache[name].loadedContent);
}

Expand Down

0 comments on commit b8ddcf9

Please sign in to comment.