diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2025-07-16 23:39:27 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-16 23:39:27 -0700 |
| commit | 69553e5ba6d46ed924b0c3adc3f8d9666550999a (patch) | |
| tree | 7711c4d9fe1919d2c6eaa841779bcde6e24b0248 /weed/notification/webhook/http.go | |
| parent | a524b4f485ce5aa2f234c742bd7d1e75386f569b (diff) | |
| download | seaweedfs-69553e5ba6d46ed924b0c3adc3f8d9666550999a.tar.xz seaweedfs-69553e5ba6d46ed924b0c3adc3f8d9666550999a.zip | |
convert error fromating to %w everywhere (#6995)
Diffstat (limited to 'weed/notification/webhook/http.go')
| -rw-r--r-- | weed/notification/webhook/http.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/notification/webhook/http.go b/weed/notification/webhook/http.go index bb6a11a09..6b1a0e26d 100644 --- a/weed/notification/webhook/http.go +++ b/weed/notification/webhook/http.go @@ -32,7 +32,7 @@ func (h *httpClient) sendMessage(message *webhookMessage) error { // Serialize the protobuf message to JSON for HTTP payload notificationData, err := json.Marshal(message.Notification) if err != nil { - return fmt.Errorf("failed to marshal notification: %v", err) + return fmt.Errorf("failed to marshal notification: %w", err) } payload := map[string]interface{}{ @@ -43,12 +43,12 @@ func (h *httpClient) sendMessage(message *webhookMessage) error { jsonData, err := json.Marshal(payload) if err != nil { - return fmt.Errorf("failed to marshal message: %v", err) + return fmt.Errorf("failed to marshal message: %w", err) } req, err := http.NewRequest(http.MethodPost, h.endpoint, bytes.NewBuffer(jsonData)) if err != nil { - return fmt.Errorf("failed to create request: %v", err) + return fmt.Errorf("failed to create request: %w", err) } req.Header.Set("Content-Type", "application/json") @@ -68,7 +68,7 @@ func (h *httpClient) sendMessage(message *webhookMessage) error { glog.Errorf("failed to drain response: %v", err) } - return fmt.Errorf("failed to send request: %v", err) + return fmt.Errorf("failed to send request: %w", err) } defer resp.Body.Close() |
