refactor: remove pkg/errors

This commit is contained in:
Fu Diwei
2025-04-22 22:12:58 +08:00
parent f5807d215f
commit 6dac89e9a1
103 changed files with 500 additions and 575 deletions

View File

@@ -146,7 +146,7 @@ func registerAcmeUser(client *lego.Client, user *acmeUser, userRegisterOptions m
}
default:
err = fmt.Errorf("unsupported ca provider: %s", user.CA)
err = fmt.Errorf("unsupported ca provider '%s'", user.CA)
}
if err != nil {
return nil, err

View File

@@ -56,7 +56,7 @@ type applicantOptions struct {
func NewWithApplyNode(node *domain.WorkflowNode) (Applicant, error) {
if node.Type != domain.WorkflowNodeTypeApply {
return nil, fmt.Errorf("node type is not apply")
return nil, fmt.Errorf("node type is not '%s'", string(domain.WorkflowNodeTypeApply))
}
nodeConfig := node.GetConfigForApply()
@@ -181,7 +181,7 @@ func apply(challengeProvider challenge.Provider, options *applicantOptions) (*Ap
if !user.hasRegistration() {
reg, err := registerAcmeUserWithSingleFlight(client, user, options.CAProviderAccessConfig)
if err != nil {
return nil, fmt.Errorf("failed to register: %w", err)
return nil, fmt.Errorf("failed to register acme user: %w", err)
}
user.Registration = reg
}

View File

@@ -509,5 +509,5 @@ func createApplicant(options *applicantOptions) (challenge.Provider, error) {
}
}
return nil, fmt.Errorf("unsupported applicant provider: %s", string(options.Provider))
return nil, fmt.Errorf("unsupported applicant provider '%s'", string(options.Provider))
}