sipeed/picoclaw · error

teams_webhook: send failed: %w

Error message

teams_webhook: send failed: %w

What it means

Error "teams_webhook: send failed: %w" thrown in sipeed/picoclaw.

Source

Thrown at pkg/channels/teams_webhook/teams_webhook.go:182

	}

	// Create the message with the card
	teamsMsg, err := adaptivecard.NewMessageFromCard(card)
	if err != nil {
		return nil, fmt.Errorf("teams_webhook: failed to create message: %w", err)
	}

	// Send to Teams
	if err := c.client.SendWithContext(ctx, target.WebhookURL.String(), teamsMsg); err != nil {
		// Log without raw error to avoid leaking webhook URL (embedded in net/http errors)
		logger.ErrorCF("teams_webhook", "Failed to send message to Teams webhook", map[string]any{
			"target": msg.ChatID,
		})
		// Classify error based on status code extracted from error message.
		// The go-teams-notify library includes status in errors like "401 Unauthorized".
		// Use ClassifySendError for proper retry behavior (4xx = permanent, 5xx = temporary).
		classifiedErr := classifyTeamsError(err)
		return nil, fmt.Errorf("teams_webhook: send failed: %w", classifiedErr)
	}

	logger.DebugCF("teams_webhook", "Message sent successfully", map[string]any{
		"target": msg.ChatID,
	})

	return nil, nil
}

// buildAdaptiveCard creates a formatted Adaptive Card from the outbound message.
// It detects markdown tables and converts them to native Adaptive Card Table elements,
// since TextBlocks only support a limited markdown subset (no tables).
func (c *TeamsWebhookChannel) buildAdaptiveCard(
	msg bus.OutboundMessage,
	target config.TeamsWebhookTarget,
) (adaptivecard.Card, error) {
	card := adaptivecard.NewCard()
	card.Type = adaptivecard.TypeAdaptiveCard

View on GitHub (pinned to 49183d7e8d)

When it happens

Trigger: Thrown at pkg/channels/teams_webhook/teams_webhook.go:182 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/685453a5896f022f. Report an issue: GitHub.