Skip to content

Commit

Permalink
[JavaToolInstaller] Fixed code review points.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Dobrodeev committed Jul 8, 2020
1 parent 2f157e8 commit 649d42a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Tasks/JavaToolInstallerV0/FileExtractor/JavaFilesExtractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ interface IDirectoriesDictionary {
}

export class JavaFilesExtractor {
readonly ERR_SHARE_ACCESS = -4094;
public destinationFolder: string;
public readonly win: boolean;

Expand Down Expand Up @@ -171,12 +172,11 @@ export class JavaFilesExtractor {

const jdkFile = path.normalize(repoRoot);

const ERR_SHARE_ACCESS = -4094;
let stats;
let stats: taskLib.FsStats;
try {
stats = taskLib.stats(jdkFile);
} catch (error) {
if (error.errno === ERR_SHARE_ACCESS) {
if (error.errno === this.ERR_SHARE_ACCESS) {
throw new Error(taskLib.loc('ShareAccessError', error.path));
}
throw(error);
Expand Down
2 changes: 1 addition & 1 deletion Tasks/JavaToolInstallerV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,6 @@
"JavaNotPreinstalled": "Java %s is not preinstalled on this agent",
"UsePreinstalledJava": "Use preinstalled JDK from %s",
"WrongArchiveStructure": "JDK file is not valid. Verify if JDK file contains only one root folder with 'bin' inside.",
"ShareAccessError": "Network shared resource not available (%s)"
"ShareAccessError": "Network shared resource not available: (%s)"
}
}

0 comments on commit 649d42a

Please sign in to comment.