Skip to content

Commit

Permalink
Wrap createPackage in try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbranch committed Feb 12, 2024
1 parent 4b738ac commit e0b48ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
9 changes: 8 additions & 1 deletion packages/dtslint/src/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,14 @@ export async function checkNpmVersionAndGetMatchingImplementationPackage(
`that does not conflict with an existing npm package.`,
);
} else {
implementationPackage = await attw.createPackageFromTarballUrl(tarballUrl);
try {
implementationPackage = await attw.createPackageFromTarballUrl(tarballUrl);
} catch (err: any) {
(warnings ??= []).push(
`Failed to extract implementation package from ${tarballUrl}. This is likely a problem with @arethetypeswrong/core ` +
`or the tarball data itself. @arethetypeswrong/cli will not run. Error:\n${err.stack ?? err.message}`
);
}
}
}
} else if (packageJson.nonNpm === "conflict") {
Expand Down
7 changes: 4 additions & 3 deletions pnpm-lock.yaml

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

0 comments on commit e0b48ed

Please sign in to comment.