Skip to content

Commit

Permalink
Fix error matching
Browse files Browse the repository at this point in the history
  • Loading branch information
pastelsky committed Dec 18, 2023
1 parent 72ca933 commit fae01d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/api/get-package-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,21 @@ export function getErrorMessage(error: {
errorStack?: string;
}) {
switch (error.name) {
case PackageNotFoundError.name:
case "PackageNotFoundError":
return "This package could not be found on the npm registry. Did you get the name right?";

case PackageVersionMismatchError.name:
case "PackageVersionMismatchError":
return `The given version for this package was not found on the npm registry.\n Found versions: \n${error.extra.join(
", ",
)}`;

case TypeDefinitionResolveError.name:
case "TypeDefinitionResolveError":
return (
"Failed to resolve types for this package. " +
"This package likely does not ship with types, and it does not have a corresponding package `@types` package " +
"from which reference documentation for its APIs can be built."
);
case TypeDocBuildError.name:
case "TypeDocBuildError":
return `Failed to generate documentation for this package. <br />
<details>
<summary>See stack trace</summary>
Expand Down

0 comments on commit fae01d3

Please sign in to comment.