Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 1498c8c

Browse files
authored
fix: improve logging when there is an error retrieving ssm parameters (#3962)
In case the AMI ID Parameter was set to something that did not exist, it would produce an obscure error: "message": "Ignoring error: UnknownError". Now it produces better error messages: "message": "Ignoring error: Error: Failed to lookup runner AMI ID from SSM parameter: /github-action-runners/staging/ubuntu-x64/runners/config/ami-id,\n ParameterNotFound: UnknownError", Signed-off-by: Brend Smits <[email protected]> Signed-off-by: Brend Smits <[email protected]>
1 parent e269d0f commit 1498c8c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Diff for: lambdas/functions/control-plane/src/aws/runners.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ async function getAmiIdOverride(runnerParameters: Runners.RunnerInputParameters)
210210
'Please ensure that the given parameter exists on this region and contains a valid runner AMI ID',
211211
{ error: e },
212212
);
213-
throw e;
213+
throw new Error(`Failed to lookup runner AMI ID from SSM parameter: ${runnerParameters.amiIdSsmParameterName},
214+
${e}`);
214215
}
215216
}
216217

Diff for: lambdas/functions/control-plane/src/lambda.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export async function scaleUpHandler(event: SQSEvent, context: Context): Promise
2424
if (e instanceof ScaleError) {
2525
throw e;
2626
} else {
27-
logger.warn(`Ignoring error: ${(e as Error).message}`);
27+
logger.warn(`Ignoring error: ${e}`);
2828
}
2929
}
3030
}

0 commit comments

Comments
 (0)