Skip to content

Commit

Permalink
Using wrapped error instead of dynamic one.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgecse committed Aug 3, 2023
1 parent f0c2046 commit d6f50ee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (c *Config) LoadJiraConfig(client *jira.Client) error {

if c.components == nil {
log.Errorf("Error occurred trying to get component from config. The Jira project does not have such component defined: %s", component)
return fmt.Errorf("reading Jira component: %s", component)
return ReadingJiraComponentError(component)
}
}

Expand Down Expand Up @@ -565,3 +565,9 @@ var (
func errCustomFieldIDNotFound(field string) error {
return fmt.Errorf("could not find ID custom field '%s'; check that it is named correctly", field) //nolint:goerr113
}

type ReadingJiraComponentError string

func (r ReadingJiraComponentError) Error() string {
return fmt.Sprintf("reading Jira component: %s", string(r))
}

0 comments on commit d6f50ee

Please sign in to comment.