From 8c1d6337b13a321659a920003901caf0f915597a Mon Sep 17 00:00:00 2001 From: Daniel Neilson <53624638+ddneilson@users.noreply.github.com> Date: Mon, 12 Feb 2024 16:32:43 +0000 Subject: [PATCH] fix: improve missing job parameter error for summary command Problem: The error message that one gets when using the summary command on a job template that has job parameters with no default value is a tad confusing. It looks like: ``` ERROR generating Job: Parameters can't be used with Template: Values missing for required job parameters: NumAnimationFrames, OutputDirectory, RenderScript ``` The "Parameters can't be used with Template" part is leading to confusion. Solution: Remove the problematic phase from the error. The error comes from trying to preprocess_job_parameters(), and that function already has decent error messaging. Signed-off-by: Daniel Neilson <53624638+ddneilson@users.noreply.github.com> --- src/openjd/cli/_common/_job_from_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openjd/cli/_common/_job_from_template.py b/src/openjd/cli/_common/_job_from_template.py index 971fd11..9f6f4cb 100644 --- a/src/openjd/cli/_common/_job_from_template.py +++ b/src/openjd/cli/_common/_job_from_template.py @@ -124,7 +124,7 @@ def job_from_template( current_working_dir=current_working_dir, ) except ValueError as ve: - raise RuntimeError(f"Parameters can't be used with Template: {str(ve)}") + raise RuntimeError(str(ve)) try: return create_job(job_template=template, job_parameter_values=parameter_values)