Skip to content

Commit f38fadb

Browse files
committed
refactor: 💡 error messages
1 parent 00dafc8 commit f38fadb

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/core/src/docs/docs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const Docs = (
5454
);
5555

5656
if (!packagesNames.includes(packageName)) {
57-
throw new Error(`Cannot find package ${packageName}`);
57+
throw new Error(`Cannot find package ${packageName}, available packages: ${packagesNames.join(", ")}`);
5858
}
5959

6060
const packageOptions = pluginOptions.packages.find((pkg) => cleanFileName(pkg.title) === packageName);

packages/core/src/importer/importer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export const importer = (options: { packageRoute: string; apiDir: string; versio
101101
const [, , packageName, componentName, componentOptions] = apiImport;
102102
// eslint-disable-next-line prettier/prettier
103103
if (!packagesNames.includes(packageName)) {
104-
throw new Error(`Cannot find package ${packageName}`);
104+
throw new Error(`Cannot find package ${packageName}, available packages: ${packagesNames.join(", ")}`);
105105
}
106106
const packageOptions = pluginOptions.packages.find((pkg) => cleanFileName(pkg.title) === packageName);
107107
if (!packageOptions) {

0 commit comments

Comments
 (0)