Skip to content

Commit

Permalink
refactor: 'promptForAuthOnError' -> 'lockProfileOnAuthError'
Browse files Browse the repository at this point in the history
Signed-off-by: Trae Yelovich <[email protected]>
  • Loading branch information
traeok committed Dec 18, 2024
1 parent aa5251c commit 43eba14
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ export class DatasetFSProvider extends BaseProvider implements vscode.FileSystem
} catch (error) {
//Response will error if the file is not found
//Callers of fetchDatasetAtUri() do not expect it to throw an error
await AuthUtils.promptForAuthOnError(error, metadata.profile);
await AuthUtils.lockProfileOnAuthError(error, metadata.profile);
return null;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/zowe-explorer/src/trees/job/JobFSProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export class JobFSProvider extends BaseProvider implements vscode.FileSystemProv
bufBuilder.write(await jesApi.getSpoolContentById(jobEntry.job.jobname, jobEntry.job.jobid, spoolEntry.spool.id));
}
} catch (err) {
await AuthUtils.promptForAuthOnError(err, spoolEntry.metadata.profile);
await AuthUtils.lockProfileOnAuthError(err, spoolEntry.metadata.profile);
throw err;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/zowe-explorer/src/trees/uss/UssFSProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export class UssFSProvider extends BaseProvider implements vscode.FileSystemProv
if (err instanceof Error) {
ZoweLogger.error(err.message);
}
await AuthUtils.promptForAuthOnError(err, metadata.profile);
await AuthUtils.lockProfileOnAuthError(err, metadata.profile);
return;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/zowe-explorer/src/utils/AuthUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface ErrorContext {
}

export class AuthUtils {
public static async promptForAuthOnError(err: Error, profile: imperative.IProfileLoaded): Promise<void> {
public static async lockProfileOnAuthError(err: Error, profile: imperative.IProfileLoaded): Promise<void> {
if (
err instanceof imperative.ImperativeError &&
profile != null &&
Expand All @@ -36,12 +36,12 @@ export class AuthUtils {
profileName: profile.name,
},
});
await AuthHandler.promptForAuthentication(err, profile, {
await AuthHandler.lockProfile(profile, err, {
ssoLogin: Constants.PROFILES_CACHE.ssoLogin.bind(Constants.PROFILES_CACHE),
promptCredentials: Constants.PROFILES_CACHE.promptCredentials.bind(Constants.PROFILES_CACHE),
isUsingTokenAuth: await AuthUtils.isUsingTokenAuth(profile.name),
errorCorrelation,
}).catch((error) => error instanceof Error && ZoweLogger.error(error.message));
});
}
}

Expand Down

0 comments on commit 43eba14

Please sign in to comment.