This commit is contained in:
2026-10-16 15:23:28 +03:00
parent 8cde0e9371
commit 84164a72a4
32 changed files with 1019 additions and 260 deletions

View File

@@ -210,7 +210,7 @@ func (ldc *LegacyDecortClient) getToken(ctx context.Context) error {
}
if resp.StatusCode != 200 {
return fmt.Errorf("cannot get token: %s", tokenBytes)
return newHTTPError("cannot get token", resp.StatusCode, tokenBytes)
}
// save token in config
@@ -291,8 +291,7 @@ func (ldc *LegacyDecortClient) do(req *http.Request, ctype string) ([]byte, erro
}
// handle errors with status code other than 200
err = fmt.Errorf("%s", respBytes)
return nil, fmt.Errorf("could not execute request: %w", err)
return nil, newHTTPError("could not execute request", resp.StatusCode, respBytes)
}
func trimLegacyConfig(cfg *config.LegacyConfig) config.LegacyConfig {