Skip to content

Commit 0549163

Browse files
committed
Include disallowed feature details in result
1 parent d58fafb commit 0549163

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/spec-common/errors.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ interface ContainerErrorData {
2121
start?: boolean;
2222
attach?: boolean;
2323
fileWithError?: string;
24+
disallowedFeatureId?: string;
25+
didStopContainer?: boolean;
2426
learnMoreUrl?: string;
2527
}
2628

src/spec-node/devContainersSpecCLI.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ async function doProvision(options: ProvisionOptions, providedIdLabels: string[]
318318
message: err.message,
319319
description: err.description,
320320
containerId: err.containerId,
321+
disallowedFeatureId: err.data.disallowedFeatureId,
322+
didStopContainer: err.data.didStopContainer,
323+
learnMoreUrl: err.data.learnMoreUrl,
321324
dispose,
322325
};
323326
}

src/spec-node/disallowedFeatures.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ export async function ensureNoDisallowedFeatures(params: DockerCLIParameters, co
4040
const documentationURL = d.disallowedFeatureEntry.documentationURL;
4141
throw new ContainerError({
4242
description: `Cannot use the '${d.configFeatureId}' Feature since it was reported to be problematic. Please remove this Feature from your configuration and rebuild any dev container using it before continuing.${stopped ? ' The existing dev container was stopped.' : ''}${documentationURL ? ` See ${documentationURL} to learn more.` : ''}`,
43+
data: {
44+
disallowedFeatureId: d.configFeatureId,
45+
didStopContainer: stopped,
46+
learnMoreUrl: documentationURL,
47+
},
4348
});
4449
}
4550

0 commit comments

Comments
 (0)