+
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/command/ReRunJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ReporterGateway from 'gateway/ReporterGateway';
import JobRunner from 'job/JobRunner';
import JobTerminals from 'terminal/JobTerminals';
import JobTreeItem from 'job/JobTreeItem';
import { DO_NOT_CONFIRM_RUN_JOB } from 'constant';
import { DO_NOT_CONFIRM_RUN_JOB, RERUN_JOB_COMMAND } from 'constant';

@injectable()
export default class ReRunJob implements Command {
Expand All @@ -27,7 +27,7 @@ export default class ReRunJob implements Command {
commandName: string;

constructor() {
this.commandName = 'local-ci.job.rerun';
this.commandName = RERUN_JOB_COMMAND;
}

getCallback(context: vscode.ExtensionContext, jobProvider: JobProvider) {
Expand Down
32 changes: 22 additions & 10 deletions src/config/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import ProcessFile from 'process/ProcessFile';
import ReporterGateway from 'gateway/ReporterGateway';
import Spawn from 'common/Spawn';
import Types from 'common/Types';
import { RERUN_JOB_COMMAND } from 'constant';

@injectable()
export default class Config {
Expand Down Expand Up @@ -79,16 +80,27 @@ export default class Config {
processError = (e as ErrorWithMessage)?.message;
if (!suppressMessage) {
const message = (e as ErrorWithMessage)?.message;
this.editorGateway.editor.window.showErrorMessage(
[
message?.includes('connection refused')
? 'Is your machine connected to the internet? '
: '',
`There was an error processing the CircleCI config: ${message}`,
]
.filter((message) => !!message)
.join(' ')
);
const tryAgain = 'Try Again';
this.editorGateway.editor.window
.showErrorMessage(
[
message?.includes('connection refused')
? 'Is your machine connected to the internet? '
: '',
`There was an error processing the CircleCI config: ${message}`,
]
.filter(Boolean)
.join(' '),
{ detail: 'Error processing config' },
tryAgain
)
.then((clicked) => {
if (clicked === tryAgain) {
this.editorGateway.editor.commands.executeCommand(
RERUN_JOB_COMMAND
);
}
});
}

reporter.sendTelemetryErrorEvent('writeProcessFile');
Expand Down
1 change: 1 addition & 0 deletions src/constant/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const DYNAMIC_CONFIG_PATH_IN_CONTAINER = path.join(
);
export const HOST_TMP_DIRECTORY = '/tmp/local-ci';
export const RUN_JOB_COMMAND = 'local-ci.job.run';
export const RERUN_JOB_COMMAND = 'local-ci.job.rerun';
export const CREATE_CONFIG_FILE_COMMAND = 'local-ci.create.config';
export const SELECT_REPO_COMMAND = 'localCiJobs.selectRepo';
export const START_DOCKER_COMMAND = 'local-ci.docker.start';
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载