File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -221,15 +221,16 @@ class NpmTranslator {
221221 log . verbose ( "Found module %s in that collection" , moduleName ) ;
222222 return modulePath ;
223223 }
224- throw new Error ( `Could not find module ${ moduleName } in collection ${ pkg . name } ` ) ;
224+ throw new Error ( `[npm translator] Could not find module ${ moduleName } in collection ${ pkg . name } ` ) ;
225225 }
226226 }
227- throw new Error ( `Could not locate module ${ moduleName } via resolve logic ` +
227+
228+ throw new Error ( `[npm translator] Could not locate module ${ moduleName } via resolve logic ` +
228229 `(error: ${ err . message } ) or in a collection` ) ;
230+ } , ( err ) => {
231+ throw new Error (
232+ `[npm translator] Failed to locate module ${ moduleName } from ${ basePath } - Error: ${ err . message } ` ) ;
229233 } ) ;
230- } ) . catch ( ( err ) => {
231- throw new Error (
232- `[npm translator] Failed to locate module ${ moduleName } from ${ basePath } - Error: ${ err . message } ` ) ;
233234 } ) ;
234235 }
235236
Original file line number Diff line number Diff line change @@ -63,8 +63,7 @@ test("Error: missing package.json", async (t) => {
6363
6464test ( "Error: missing dependency" , async ( t ) => {
6565 const error = await t . throws ( npmTranslator . generateDependencyTree ( errApplicationAPath ) ) ;
66- t . is ( error . message , "[npm translator] Failed to locate module library.xx from " +
67- errApplicationAPath + " - Error: Could not locate " +
66+ t . is ( error . message , "[npm translator] Could not locate " +
6867 "module library.xx via resolve logic (error: Cannot find module 'library.xx/package.json' from '" +
6968 errApplicationAPath + "') or in a collection" ) ;
7069} ) ;
You can’t perform that action at this time.
0 commit comments