Localize user-facing UI, agent output, and backend messages to Simplified Chinese
ci / go (push) Waiting to run
ci / go-db (agent) (push) Waiting to run
ci / go-db (config) (push) Waiting to run
ci / go-db (db) (push) Waiting to run
ci / go-db (evidence) (push) Waiting to run
ci / go-db (llmrec) (push) Waiting to run
ci / go-db (server) (push) Waiting to run
detections / detections (push) Waiting to run
docs / links (push) Waiting to run
web / web (push) Waiting to run
ci / go (push) Waiting to run
ci / go-db (agent) (push) Waiting to run
ci / go-db (config) (push) Waiting to run
ci / go-db (db) (push) Waiting to run
ci / go-db (evidence) (push) Waiting to run
ci / go-db (llmrec) (push) Waiting to run
ci / go-db (server) (push) Waiting to run
detections / detections (push) Waiting to run
docs / links (push) Waiting to run
web / web (push) Waiting to run
This commit is contained in:
+5
-5
@@ -34,10 +34,10 @@ func (weComChannel) DestinationKeys() []string { return []string{"webhook"} }
|
||||
func (weComChannel) Validate(cfg map[string]any) error {
|
||||
hook := cfgString(cfg, "webhook")
|
||||
if hook == "" {
|
||||
return errors.New("Webhook 주소가 없습니다")
|
||||
return errors.New("缺少 Webhook 地址")
|
||||
}
|
||||
if err := validateHTTPURL(hook); err != nil {
|
||||
return fmt.Errorf("Webhook 주소가 올바르지 않습니다: %w", err)
|
||||
return fmt.Errorf("Webhook 地址无效:%w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -62,17 +62,17 @@ func (c weComChannel) Send(ctx context.Context, cfg map[string]any, m Message) (
|
||||
ErrMsg string `json:"errmsg"`
|
||||
}
|
||||
if err := json.Unmarshal(raw, &res); err != nil {
|
||||
return 0, fmt.Errorf("WeCom 응답을 해석하지 못했습니다: %w (%s)", err, snippet(raw))
|
||||
return 0, fmt.Errorf("无法解析 WeCom 响应:%w (%s)", err, snippet(raw))
|
||||
}
|
||||
if res.ErrCode != 0 {
|
||||
// 45009 是接口调用超过限制——平台的限流窗口会滚动,退避后重试是有效的,
|
||||
// 所以显式归为可重试。走到这里说明客户端 rate_per_min 配得过于激进,
|
||||
// 重试只是兜底,真正的修法是调低该渠道的限流值。
|
||||
if res.ErrCode == 45009 {
|
||||
return 0, fmt.Errorf("WeCom 요청이 제한되었습니다 (%d): %s", res.ErrCode, res.ErrMsg)
|
||||
return 0, fmt.Errorf("WeCom 请求受限 (%d):%s", res.ErrCode, res.ErrMsg)
|
||||
}
|
||||
// 93000 是 webhook key 无效——永久失败,重试不会自愈。
|
||||
return 0, Permanent(fmt.Errorf("WeCom에서 오류가 발생했습니다 (%d): %s", res.ErrCode, res.ErrMsg))
|
||||
return 0, Permanent(fmt.Errorf("WeCom 发生错误 (%d):%s", res.ErrCode, res.ErrMsg))
|
||||
}
|
||||
return kept, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user