Skip to content

Commit

Permalink
Throw proper error when nightwatch config file not found.
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 committed Feb 15, 2024
1 parent 1bc3bed commit c8c80d8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/extensionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ export class ExtensionManager {
delete __non_webpack_require__.cache[
__non_webpack_require__.resolve(res[0].path)
];
const nwConfig = require(/* webpackIgnore: true */ res[0].path);
const workspaceState = this.context.workspaceState;
workspaceState.update('nwConfig', nwConfig);
try {
const nwConfig = require(/* webpackIgnore: true */ res[0].path);
const workspaceState = this.context.workspaceState;
workspaceState.update('nwConfig', nwConfig);
} catch (err) {
throw new Error(`Error while trying to require Nightwatch config file from "${res[0].path}": ${err}`)
}
});

nightwatchExt.startSession();
Expand Down

0 comments on commit c8c80d8

Please sign in to comment.