Skip to content

Commit

Permalink
fix: parse non-JSON response objects correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed Sep 17, 2024
1 parent d1c6a20 commit e368024
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/BaseApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,21 @@ export class BaseApi {
};

if (response.status < 200 || response.status >= 300) {
const error = (await response.json()) as APIError;
console.log(response);
let error: APIError;
try {
error = (await response.json()) as APIError;
} catch (_) {
throw new StreamError(

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-node (18)

__tests__/users.test.ts > user API > ban and unban

Error: Stream error: 404 - Not Found ❯ StreamChatClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamChatClient.ChatApi.queryBannedUsers src/gen/chat/ChatApi.ts:1699:22 ❯ __tests__/users.test.ts:106:25 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: 'c104ce4c-64f2-44b5-98a9-57736832d8d7', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 404, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 404 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-node (18)

__tests__/users.test.ts > user API > ban and unban

Error: Stream error: 404 - Not Found ❯ StreamChatClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamChatClient.ChatApi.queryBannedUsers src/gen/chat/ChatApi.ts:1699:22 ❯ __tests__/users.test.ts:106:25 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: '407f70b9-abeb-47e8-a823-b52b88f683a8', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 404, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 404 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-node (18)

__tests__/users.test.ts > user API > ban and unban

Error: Stream error: 404 - Not Found ❯ StreamChatClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamChatClient.ChatApi.queryBannedUsers src/gen/chat/ChatApi.ts:1699:22 ❯ __tests__/users.test.ts:106:25 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: 'fbf96401-7848-4efa-8658-456ed633d59e', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 404, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 404 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-node (18)

__tests__/users.test.ts > user API > ban and unban

Error: Stream error: 404 - Not Found ❯ StreamChatClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamChatClient.ChatApi.queryBannedUsers src/gen/chat/ChatApi.ts:1699:22 ❯ __tests__/users.test.ts:106:25 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: '02950351-af50-4be3-b031-779ad0a50033', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 404, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 404 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-node (18)

__tests__/users.test.ts > user API > block and unblock

Error: Stream error: 405 - Method Not Allowed ❯ StreamClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamClient.CommonApi.blockUsers src/gen/common/CommonApi.ts:822:22 ❯ __tests__/users.test.ts:152:27 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: '49bfe37f-0a6f-4d0f-89a1-4d58efe20f0d', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 405, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 405 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-node (18)

__tests__/users.test.ts > user API > block and unblock

Error: Stream error: 405 - Method Not Allowed ❯ StreamClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamClient.CommonApi.blockUsers src/gen/common/CommonApi.ts:822:22 ❯ __tests__/users.test.ts:152:27 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: '8c7037d6-09e4-4663-8f3e-74725e3d821d', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 405, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 405 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-node (18)

__tests__/users.test.ts > user API > block and unblock

Error: Stream error: 405 - Method Not Allowed ❯ StreamClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamClient.CommonApi.blockUsers src/gen/common/CommonApi.ts:822:22 ❯ __tests__/users.test.ts:152:27 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: '06a97b63-c189-4582-b2f4-65177fd45aaf', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 405, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 405 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-node (18)

__tests__/users.test.ts > user API > block and unblock

Error: Stream error: 405 - Method Not Allowed ❯ StreamClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamClient.CommonApi.blockUsers src/gen/common/CommonApi.ts:822:22 ❯ __tests__/users.test.ts:152:27 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: '88fc5128-0149-4539-b3f3-386263493a79', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 405, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 405 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-bun

__tests__/users.test.ts > user API > ban and unban

Error: Stream error: 404 - Not Found ❯ StreamChatClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamChatClient.ChatApi.queryBannedUsers src/gen/chat/ChatApi.ts:1699:22 ❯ __tests__/users.test.ts:106:25 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: '82a16096-66fb-4ce0-9306-c9963d31a4d0', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 404, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 404 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-bun

__tests__/users.test.ts > user API > ban and unban

Error: Stream error: 404 - Not Found ❯ StreamChatClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamChatClient.ChatApi.queryBannedUsers src/gen/chat/ChatApi.ts:1699:22 ❯ __tests__/users.test.ts:106:25 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: 'bab8667b-3f0f-456c-b7bd-d0c9702004bb', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 404, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 404 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-bun

__tests__/users.test.ts > user API > ban and unban

Error: Stream error: 404 - Not Found ❯ StreamChatClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamChatClient.ChatApi.queryBannedUsers src/gen/chat/ChatApi.ts:1699:22 ❯ __tests__/users.test.ts:106:25 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: '184140d6-d7b6-4dcb-99ea-32a96025c000', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 404, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 404 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-bun

__tests__/users.test.ts > user API > ban and unban

Error: Stream error: 404 - Not Found ❯ StreamChatClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamChatClient.ChatApi.queryBannedUsers src/gen/chat/ChatApi.ts:1699:22 ❯ __tests__/users.test.ts:106:25 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: '8ba8d20e-55ac-46c9-b837-470e77abaf0e', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 404, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 404 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-bun

__tests__/users.test.ts > user API > block and unblock

Error: Stream error: 405 - Method Not Allowed ❯ StreamClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamClient.CommonApi.blockUsers src/gen/common/CommonApi.ts:822:22 ❯ __tests__/users.test.ts:152:27 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: '23d453f9-2d6e-4570-9caa-bf799b55c346', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 405, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 405 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-bun

__tests__/users.test.ts > user API > block and unblock

Error: Stream error: 405 - Method Not Allowed ❯ StreamClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamClient.CommonApi.blockUsers src/gen/common/CommonApi.ts:822:22 ❯ __tests__/users.test.ts:152:27 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: '74afb228-580a-4b26-956d-fa5caf4e7e0b', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 405, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 405 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-bun

__tests__/users.test.ts > user API > block and unblock

Error: Stream error: 405 - Method Not Allowed ❯ StreamClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamClient.CommonApi.blockUsers src/gen/common/CommonApi.ts:822:22 ❯ __tests__/users.test.ts:152:27 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: 'edde8f06-4225-4a22-80d3-241843f9ee0b', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 405, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 405 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-bun

__tests__/users.test.ts > user API > block and unblock

Error: Stream error: 405 - Method Not Allowed ❯ StreamClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamClient.CommonApi.blockUsers src/gen/common/CommonApi.ts:822:22 ❯ __tests__/users.test.ts:152:27 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: '095aad20-6fad-412b-9011-f0dafd4e4765', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 405, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 405 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-node (20)

__tests__/users.test.ts > user API > ban and unban

Error: Stream error: 404 - Not Found ❯ StreamChatClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamChatClient.ChatApi.queryBannedUsers src/gen/chat/ChatApi.ts:1699:22 ❯ __tests__/users.test.ts:106:25 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: 'dccf90d7-7de1-43d4-a838-137fefdb983f', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 404, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 404 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-node (20)

__tests__/users.test.ts > user API > ban and unban

Error: Stream error: 404 - Not Found ❯ StreamChatClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamChatClient.ChatApi.queryBannedUsers src/gen/chat/ChatApi.ts:1699:22 ❯ __tests__/users.test.ts:106:25 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: 'dfaf05de-861d-4e0d-b029-d8e1e575e511', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 404, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 404 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-node (20)

__tests__/users.test.ts > user API > ban and unban

Error: Stream error: 404 - Not Found ❯ StreamChatClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamChatClient.ChatApi.queryBannedUsers src/gen/chat/ChatApi.ts:1699:22 ❯ __tests__/users.test.ts:106:25 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: '19aa23c2-10d3-45cf-9e44-3bc13bbf0e6b', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 404, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 404 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-node (20)

__tests__/users.test.ts > user API > ban and unban

Error: Stream error: 404 - Not Found ❯ StreamChatClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamChatClient.ChatApi.queryBannedUsers src/gen/chat/ChatApi.ts:1699:22 ❯ __tests__/users.test.ts:106:25 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: '646c5c0d-a043-4d46-bda7-441823c38f0e', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 404, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 404 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-node (20)

__tests__/users.test.ts > user API > block and unblock

Error: Stream error: 405 - Method Not Allowed ❯ StreamClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamClient.CommonApi.blockUsers src/gen/common/CommonApi.ts:822:22 ❯ __tests__/users.test.ts:152:27 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: '86b02e77-48b3-462e-af75-e4d82f31756d', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 405, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 405 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-node (20)

__tests__/users.test.ts > user API > block and unblock

Error: Stream error: 405 - Method Not Allowed ❯ StreamClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamClient.CommonApi.blockUsers src/gen/common/CommonApi.ts:822:22 ❯ __tests__/users.test.ts:152:27 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: 'b217d5d8-a300-4377-a127-65f48cb8bc55', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 405, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 405 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-node (20)

__tests__/users.test.ts > user API > block and unblock

Error: Stream error: 405 - Method Not Allowed ❯ StreamClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamClient.CommonApi.blockUsers src/gen/common/CommonApi.ts:822:22 ❯ __tests__/users.test.ts:152:27 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: '05869618-18fe-4c2d-be51-fab51a04eb6e', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 405, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 405 }

Check failure on line 60 in src/BaseApi.ts

View workflow job for this annotation

GitHub Actions / test-node (20)

__tests__/users.test.ts > user API > block and unblock

Error: Stream error: 405 - Method Not Allowed ❯ StreamClient.BaseApi.sendRequest src/BaseApi.ts:60:17 ❯ StreamClient.CommonApi.blockUsers src/gen/common/CommonApi.ts:822:22 ❯ __tests__/users.test.ts:152:27 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { metadata: { clientRequestId: '08e0b5fc-61eb-4d03-9dad-f94dc033a608', responseHeaders: { constructor: 'Function<Headers>', append: 'Function<append>', delete: 'Function<delete>', get: 'Function<get>', has: 'Function<has>', set: 'Function<set>', getSetCookie: 'Function<getSetCookie>', keys: 'Function<keys>', values: 'Function<values>', entries: 'Function<entries>', forEach: 'Function<forEach>' }, responseCode: 405, rateLimit: { rateLimit: undefined, rateLimitRemaining: undefined, rateLimitReset: undefined } }, code: 405 }
`Stream error: ${response.status} - ${response.statusText}`,
metadata,
response.status,
);
}
throw new StreamError(
`Stream error code ${error.code}: ${error.message}`,
`Stream error code ${error!.code}: ${error!.message}`,
metadata,
error.code,
error!.code,
undefined,
);
}
Expand Down

0 comments on commit e368024

Please sign in to comment.