Skip to content

Conversation

@tlm
Copy link
Member

@tlm tlm commented Oct 3, 2023

  • Upgrades juju/errors usage to v1 for ConstError support.
  • Introduces a new typed error as part of Tag parsing.
  • Changes the kind string error message to support the parsed tag error message.

- Upgrades juju/errors usage to v1 for ConstError support.
- Introduces a new typed error as part of Tag parsing.
- Changes the kind string error message to support the parsed tag error
  message.
func invalidTagError(tag, kind string) error {
if kind != "" {
return fmt.Errorf("%q is not a valid %s tag", tag, kind)
return fmt.Errorf("%q is %w of kind %s", tag, ErrorNotValid, kind)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use errors.Hide to keep the same error string, which would mean it reads better but also fulfils the requirement of errors.Is(_, ErrorNotValid) == true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants