Skip to content

Commit

Permalink
Remove unused series based error type
Browse files Browse the repository at this point in the history
unsupportedSeriesError is now no longer used anywhere in juju. We use
unsupportedBaseError instead

Remove this superfluous error type
  • Loading branch information
jack-w-shaw committed May 22, 2024
1 parent 03b5c0b commit cfe0aff
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions core/charm/charmpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,32 +143,6 @@ func IsInvalidPathError(err error) bool {
return ok
}

// UnsupportedSeriesError represents an error indicating that the requested series
// is not supported by the charm.
type unsupportedSeriesError struct {
requestedSeries string
supportedSeries []string
}

func (e *unsupportedSeriesError) Error() string {
return fmt.Sprintf(
"series %q not supported by charm, the charm supported series are: %s",
e.requestedSeries, strings.Join(e.supportedSeries, ","),
)
}

// NewUnsupportedSeriesError returns an error indicating that the requested series
// is not supported by a charm.
func NewUnsupportedSeriesError(requestedSeries string, supportedSeries []string) error {
return &unsupportedSeriesError{requestedSeries, supportedSeries}
}

// IsUnsupportedSeriesError returns true if err is an UnsupportedSeriesError.
func IsUnsupportedSeriesError(err error) bool {
_, ok := err.(*unsupportedSeriesError)
return ok
}

// unsupportedBaseError represents an error indicating that the requested base
// is not supported by the charm.
type unsupportedBaseError struct {
Expand Down

0 comments on commit cfe0aff

Please sign in to comment.