Skip to content

Commit

Permalink
Adds a more clear error output if the wrong drivers. angular#393
Browse files Browse the repository at this point in the history
  • Loading branch information
bmsdave committed Jun 7, 2019
1 parent 8718dc5 commit c6d5de8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/binaries/chrome_xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ export class ChromeXml extends XmlConfigSource {
private getSpecificChromeDriverVersion(inputVersion: string): Promise<BinaryUrl> {
return this.getVersionList().then(list => {
const specificVersion = getValidSemver(inputVersion);

if (specificVersion === "") {
throw new Error(`version ${inputVersion} ChromeDriver does not exist`)
}
let itemFound = '';
for (let item of list) {
// Get a semantic version.
Expand Down
6 changes: 5 additions & 1 deletion lib/cmds/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,11 @@ function unzip<T extends Binary>(binary: T, outputDir: string, fileName: string)
// unzip the file
logger.info(binary.name + ': unzipping ' + fileName);
if (fileName.slice(-4) == '.zip') {
let zip = new AdmZip(path.resolve(outputDir, fileName));
try {
let zip = new AdmZip(path.resolve(outputDir, fileName));
} catch (e) {
throw new Error(`Invalid filename: ${path.resolve(outputDir, fileName)}`)
}
zip.extractAllTo(outputDir, true);
} else {
// We will only ever get .tar files on linux
Expand Down
2 changes: 1 addition & 1 deletion lib/files/downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class Downloader {
});
})
.catch(error => {
logger.error((error as any).msg);
logger.error((error as any).msg || (error as any).message);
});
}
}

0 comments on commit c6d5de8

Please sign in to comment.