You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
readonly retryable:boolean; // whether retrying the request may succeed
73
+
readonly grpcCode:number; // underlying gRPC status code
74
+
readonly context:Record<string, string>; // extra debug info from gRPC trailing metadata
63
75
}
64
76
```
65
77
66
-
`retryable` is `true` for `RateLimitError` and `ConnectionError`, `false` for all others.
78
+
The `retryable` flag is read from the server's gRPC trailing metadata (`x-retryable` header), so it is determined by the server on a per-response basis. By convention, `RateLimitError` and `ConnectionError` are typically retryable, but the server may override this for any error type.
if (errinstanceofIMessageError&&err.code===ErrorCode.chatNotFound) {
97
+
// handle specifically
98
+
}
99
+
```
67
100
68
101
## Retrying with the SDK
69
102
@@ -75,8 +108,8 @@ const im = createClient({
75
108
token: "...",
76
109
retry: {
77
110
maxAttempts: 3,
78
-
initialDelayMs: 200,
79
-
maxDelayMs: 2000,
111
+
initialDelay: 200,
112
+
maxDelay: 5000,
80
113
},
81
114
});
82
115
```
@@ -85,14 +118,14 @@ When `retry` is enabled, `ConnectionError` and `RateLimitError` are retried tran
85
118
86
119
## Escape hatch: `_raw`
87
120
88
-
If the error exposes insufficient detail, every domain type (including errors) carries`_raw`- the raw gRPC response - for debugging:
121
+
Most domain types carry `_raw` containing the raw gRPC response for debugging purposes. The types that include`_raw`are `Chat`, `Message`, `AttachmentInfo`, and `AddressInfo`. Other types such as `ScheduledMessage`, `FindMyFriend`, and `PollInfo` do not include `_raw`.
0 commit comments