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
* Return a friendly, actionable hint for known Ably error codes.
10
+
* Returns undefined for unknown codes.
11
+
*/
12
+
exportfunctiongetFriendlyAblyErrorHint(
13
+
code: number|undefined,
14
+
): string|undefined{
15
+
if(code===undefined)returnundefined;
16
+
17
+
consthints: Record<number,string>={
18
+
40101:
19
+
'The credentials provided are not valid. Check your API key or token, or re-authenticate with "ably login".',
20
+
40103: 'The token has expired. Please re-authenticate with "ably login".',
21
+
40110:
22
+
'Unable to authorize. Check your authentication configuration or re-authenticate with "ably login".',
23
+
40160:
24
+
"The API key does not have the capability to perform this operation on the requested resource. Check the key's channel capability configuration in the Ably dashboard.",
25
+
40161:
26
+
"The API key does not have publish capability on this resource. Check the key's channel capability configuration in the Ably dashboard.",
27
+
40171:
28
+
"The requested operation is not permitted by the API key's capabilities. Check the key's capability configuration in the Ably dashboard.",
0 commit comments