]> git.giacomolli.uk - onechat/blobdiff - telegram_api.go
Name subtests for the behavior they prove
[onechat] / telegram_api.go
index 3a44a0d201e3552386045ab668b8ae72bc65e177..0d44852f133e59d167543b967627d03b09bb1b73 100644 (file)
@@ -333,8 +333,8 @@ func (b *TelegramAPI) SendTyping(ctx context.Context, chat int64) error {
 
 // call sends one call of method with the JSON params and decodes its result
 // into result, when result is not nil. The call can take up to timeout. Its
 
 // call sends one call of method with the JSON params and decodes its result
 // into result, when result is not nil. The call can take up to timeout. Its
-// errors tell the cause in plain words, with no method name, so that a log line
-// can say first what the call was for.
+// request setup errors name the method. Network and answer errors give a safe
+// cause, so the caller can add the operation without exposing the request URL.
 func (b *TelegramAPI) call(ctx context.Context, timeout time.Duration, method string, params, result any) error {
        ctx, cancel := context.WithTimeout(ctx, timeout)
        defer cancel()
 func (b *TelegramAPI) call(ctx context.Context, timeout time.Duration, method string, params, result any) error {
        ctx, cancel := context.WithTimeout(ctx, timeout)
        defer cancel()