Skip to content

Commit

Permalink
refactor: component path error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Mar 10, 2023
1 parent 68649ac commit e7590e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/find-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function searchInFolders(tag, fileNameFromTag, options) {
const componentPath = search(options.root, options.folders, fileNameFromTag, options.fileExtension);

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

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

if (!namespaceOption) {
throw new Error(`[components] Unknown component namespace ${namespace}.`);
throw new Error(`[components] Unknown component namespace: ${namespace}.`);
}

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

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

return componentPath;
Expand Down

0 comments on commit e7590e2

Please sign in to comment.