Skip to content

Commit

Permalink
Merge pull request juju#17400 from jack-w-shaw/remove_used_code
Browse files Browse the repository at this point in the history
juju#17400

Remove unused series based error type

unsupportedSeriesError is now no longer used anywhere in juju. We use unsupportedBaseError instead

Remove this superfluous error type

## QA steps

juju compiles
  • Loading branch information
jujubot authored May 22, 2024
2 parents 03b5c0b + cfe0aff commit 5be5c43
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 5be5c43

Please sign in to comment.