Skip to content

Commit c6d5de8

Browse files
committed
Adds a more clear error output if the wrong drivers. angular#393
1 parent 8718dc5 commit c6d5de8

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

lib/binaries/chrome_xml.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ export class ChromeXml extends XmlConfigSource {
108108
private getSpecificChromeDriverVersion(inputVersion: string): Promise<BinaryUrl> {
109109
return this.getVersionList().then(list => {
110110
const specificVersion = getValidSemver(inputVersion);
111-
111+
if (specificVersion === "") {
112+
throw new Error(`version ${inputVersion} ChromeDriver does not exist`)
113+
}
112114
let itemFound = '';
113115
for (let item of list) {
114116
// Get a semantic version.

lib/cmds/update.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,11 @@ function unzip<T extends Binary>(binary: T, outputDir: string, fileName: string)
247247
// unzip the file
248248
logger.info(binary.name + ': unzipping ' + fileName);
249249
if (fileName.slice(-4) == '.zip') {
250-
let zip = new AdmZip(path.resolve(outputDir, fileName));
250+
try {
251+
let zip = new AdmZip(path.resolve(outputDir, fileName));
252+
} catch (e) {
253+
throw new Error(`Invalid filename: ${path.resolve(outputDir, fileName)}`)
254+
}
251255
zip.extractAllTo(outputDir, true);
252256
} else {
253257
// We will only ever get .tar files on linux

lib/files/downloader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class Downloader {
103103
});
104104
})
105105
.catch(error => {
106-
logger.error((error as any).msg);
106+
logger.error((error as any).msg || (error as any).message);
107107
});
108108
}
109109
}

0 commit comments

Comments
 (0)