diff options
Diffstat (limited to 'weed/notification/webhook')
| -rw-r--r-- | weed/notification/webhook/http.go | 8 | ||||
| -rw-r--r-- | weed/notification/webhook/webhook_queue.go | 4 |
2 files changed, 6 insertions, 6 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() diff --git a/weed/notification/webhook/webhook_queue.go b/weed/notification/webhook/webhook_queue.go index f5853dc2d..b1b21bc9a 100644 --- a/weed/notification/webhook/webhook_queue.go +++ b/weed/notification/webhook/webhook_queue.go @@ -120,7 +120,7 @@ func (w *Queue) setupWatermillQueue(cfg *config) error { logger, ) if err != nil { - return fmt.Errorf("failed to create router: %v", err) + return fmt.Errorf("failed to create router: %w", err) } w.router = router @@ -135,7 +135,7 @@ func (w *Queue) setupWatermillQueue(cfg *config) error { poisonQueue, err := middleware.PoisonQueue(w.queueChannel, deadLetterTopic) if err != nil { - return fmt.Errorf("failed to create poison queue: %v", err) + return fmt.Errorf("failed to create poison queue: %w", err) } router.AddPlugin(plugin.SignalsHandler) |
