Skip to content

Commit e7590e2

Browse files
committedMar 10, 2023
refactor: component path error messages
1 parent 68649ac commit e7590e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/find-path.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function searchInFolders(tag, fileNameFromTag, options) {
4444
const componentPath = search(options.root, options.folders, fileNameFromTag, options.fileExtension);
4545

4646
if (!componentPath) {
47-
throw new Error(`[components] For the tag ${tag} was not found any template in defined root path ${options.folders.join(', ')}`);
47+
throw new Error(`[components] <${tag}> could not find ${fileNameFromTag} in the defined root paths (${options.folders.join(', ')})`);
4848
}
4949

5050
return componentPath;
@@ -63,7 +63,7 @@ function searchInNamespaces(tag, [namespace, fileNameFromTag], options) {
6363
const namespaceOption = options.namespaces.find(n => n.name === namespace.replace(options.tagPrefix, ''));
6464

6565
if (!namespaceOption) {
66-
throw new Error(`[components] Unknown component namespace ${namespace}.`);
66+
throw new Error(`[components] Unknown component namespace: ${namespace}.`);
6767
}
6868

6969
let componentPath;
@@ -84,7 +84,7 @@ function searchInNamespaces(tag, [namespace, fileNameFromTag], options) {
8484
}
8585

8686
if (!componentPath && options.strict) {
87-
throw new Error(`[components] For the tag ${tag} was not found any template in the defined namespace's base path ${namespaceOption.root}.`);
87+
throw new Error(`[components] <${tag}> could not find ${fileNameFromTag} in the defined namespace base path ${namespaceOption.root}`);
8888
}
8989

9090
return componentPath;

0 commit comments

Comments
 (0)
Please sign in to comment.