pipecd icon indicating copy to clipboard operation
pipecd copied to clipboard

fix(pkg/config): use provider type instead of name in unsupported type error messages

Open kunal-yelgate opened this issue 5 months ago • 1 comments

Description

The error messages returned by PipedPlatformProvider.MarshalJSON() and PipedAnalysisProvider.MarshalJSON() incorrectly display the provider's Name rather than the invalid Type when an unsupported provider type is encountered.

Current Behavior

In pkg/config/piped.go, the following error messages are generated:

default:
    err = fmt.Errorf("unsupported platform provider type: %s", p.Name)
default:
    err = fmt.Errorf("unsupported analysis provider type: %s", p.Name)

As a result, users see the provider name instead of the actual invalid type value.

Example:

platformProviders:
  - name: my-provider
    type: UNKNOWN_TYPE

Current error:

unsupported platform provider type: my-provider

Expected Behavior

The error should report the unsupported type value:

unsupported platform provider type: UNKNOWN_TYPE

Benefits

  • Improves debugging experience.
  • Makes error messages accurate and actionable.
  • Reduces confusion when diagnosing configuration issues.
  • No functional behavior changes; only error message output is corrected.

kunal-yelgate avatar Jun 23 '26 15:06 kunal-yelgate

I'd like to work on this.

singhharsh1708 avatar Sep 06 '26 06:09 singhharsh1708