mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-01 06:36:38 +08:00
autoresearch iter 10: keep error identity at the last errorlint sites
RunPushTest flattened channel validation failures with %v, telegram's fallback path discarded the original send error, and the config loader's type assertion on viper.ConfigFileNotFoundError would miss a wrapped form and fatally abort over a merely missing file. errorlint now reports zero.
This commit is contained in:
@@ -76,7 +76,7 @@ func (p *TelegramPusher) Send(ctx context.Context, cfg Config, target string, bo
|
||||
}
|
||||
fallbackErr := p.sendMessage(ctx, baseURL, cfg.Secret, chatID, plainText, "")
|
||||
if fallbackErr != nil {
|
||||
return "", fmt.Errorf("telegram: send message failed (fallback also failed): %w (original HTML error: %v)", fallbackErr, err)
|
||||
return "", fmt.Errorf("telegram: send message failed (fallback also failed): %w (original HTML error: %w)", fallbackErr, err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ func RunPushTest(ctx context.Context, cfg pkgpush.Config, target string) error {
|
||||
return err
|
||||
}
|
||||
if err := pusher.ValidateConfig(cfg); err != nil {
|
||||
return fmt.Errorf("%s: %v", errs.ErrValidationFailed, err)
|
||||
return fmt.Errorf("%s: %w", errs.ErrValidationFailed, err)
|
||||
}
|
||||
|
||||
ApplySMTPFallbackToPushConfig(ctx, &cfg)
|
||||
|
||||
Reference in New Issue
Block a user