chenhg5/cc-connect · error

empty URL

Error message

empty URL

What it means

Validation guard in the tuitui platform's downloadAttachment helper: the raw attachment URL argument is empty, so the voice/file/image download cannot proceed; callers log a warning and skip the attachment.

Source

Thrown at platform/tuitui/tuitui.go:848

			files = append(files, core.FileAttachment{MimeType: mimeType, Data: buf, FileName: name})
		}
	}

	var audio *core.AudioAttachment
	if data.Voice != "" {
		buf, mimeType, name, err := p.downloadAttachment(ctx, data.Voice)
		if err != nil {
			slog.Warn("tuitui: voice download failed", "error", err)
		} else {
			audio = &core.AudioAttachment{MimeType: mimeType, Data: buf, Format: extFormat(name)}
		}
	}
	return images, files, audio
}

func (p *Platform) downloadAttachment(ctx context.Context, rawURL string) ([]byte, string, string, error) {
	if rawURL == "" {
		return nil, "", "", fmt.Errorf("empty URL")
	}
	dctx, cancel := context.WithTimeout(ctx, attachmentDownloadTO)
	defer cancel()
	req, err := http.NewRequestWithContext(dctx, http.MethodGet, rawURL, nil)
	if err != nil {
		return nil, "", "", err
	}
	resp, err := p.client.Do(req)
	if err != nil {
		return nil, "", "", errorsRedacted(err, p.appSecret)
	}
	defer func() { _ = resp.Body.Close() }()
	if resp.StatusCode < 200 || resp.StatusCode >= 300 {
		return nil, "", "", fmt.Errorf("HTTP %d", resp.StatusCode)
	}
	if resp.ContentLength > maxAttachmentBytes {
		return nil, "", "", fmt.Errorf("attachment too large: %d", resp.ContentLength)
	}

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Check the inbound event actually carries an attachment URL
  2. Skip attachment processing when absent
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at platform/tuitui/tuitui.go:848 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/54636be418fd5e86. Report an issue: GitHub.