Skip to content

Commit 7fcc0c0

Browse files
authored
chore(pipelines): reference discoverReferencedOutputs in error message (#19176)
The need to call this function is referenced in the README, but if you already have written custom steps you're not going to read the README again. Include the same hints in the error message. Fixes #19173. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 16d7552 commit 7fcc0c0

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/@aws-cdk/pipelines/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ class MyJenkinsStep extends pipelines.Step implements pipelines.ICodePipelineAct
801801
) {
802802
super('MyJenkinsStep');
803803

804-
// This is necessary if your step accepts things like environment variables
804+
// This is necessary if your step accepts parametres, like environment variables,
805805
// that may contain outputs from other steps. It doesn't matter what the
806806
// structure is, as long as it contains the values that may contain outputs.
807807
this.discoverReferencedOutputs({

packages/@aws-cdk/pipelines/lib/blueprint/step.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ export abstract class Step implements IFileSetProducer {
105105
/**
106106
* Crawl the given structure for references to StepOutputs and add dependencies on all steps found
107107
*
108-
* Should be called by subclasses based on what the user passes in as
109-
* construction properties. The format of the structure passed in here does
110-
* not have to correspond exactly to what gets rendered into the engine, it
111-
* just needs to contain the same amount of data.
108+
* Should be called in the constructor of subclasses based on what the user
109+
* passes in as construction properties. The format of the structure passed in
110+
* here does not have to correspond exactly to what gets rendered into the
111+
* engine, it just needs to contain the same data.
112112
*/
113113
protected discoverReferencedOutputs(structure: any) {
114114
for (const output of StepOutput.findAll(structure)) {

packages/@aws-cdk/pipelines/lib/helpers-internal/step-output.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export class StepOutput implements IResolvable {
104104

105105
public resolve(_context: IResolveContext) {
106106
if (this.resolution === undefined) {
107-
throw new Error(`Output for step ${this.step} not configured. Either the step is not in the pipeline, or this engine does not support Outputs for this step.`);
107+
throw new Error(`Output for step ${this.step} not configured. Either the step is not in the pipeline, the step implementation did not call 'this.discoverReferencedOutputs()', or this engine does not support Outputs for this step.`);
108108
}
109109
return this.resolution;
110110
}

0 commit comments

Comments
 (0)