|
1 | 1 | import { fromPartial } from '@total-typescript/shoehorn'; |
2 | 2 | import { nanoid } from 'nanoid'; |
3 | 3 | import React, { useEffect } from 'react'; |
4 | | -import { ErrorFromResponse, SearchController } from 'stream-chat'; |
| 4 | +import { SearchController, StreamAPIError } from 'stream-chat'; |
5 | 5 | import type { |
6 | 6 | Channel as ChannelType, |
7 | 7 | LocalMessage, |
@@ -2053,7 +2053,7 @@ describe('Channel', () => { |
2053 | 2053 | expect(msg.status).toBe('received'); |
2054 | 2054 | }); |
2055 | 2055 |
|
2056 | | - it('should convert axios network errors to ErrorFromResponse when sending fails', async () => { |
| 2056 | + it('should convert axios network errors to StreamAPIError when sending fails', async () => { |
2057 | 2057 | const messageText = nanoid(); |
2058 | 2058 | const messageId = nanoid(); |
2059 | 2059 | const axiosNetworkError = Object.assign(new Error('Network Error'), { |
@@ -2087,7 +2087,7 @@ describe('Channel', () => { |
2087 | 2087 | const failedMessage = channel.state.findMessage(messageId); |
2088 | 2088 | expect(failedMessage).toBeDefined(); |
2089 | 2089 | expect(failedMessage.status).toBe('failed'); |
2090 | | - expect(failedMessage.error).toBeInstanceOf(ErrorFromResponse); |
| 2090 | + expect(failedMessage.error).toBeInstanceOf(StreamAPIError); |
2091 | 2091 | expect(failedMessage.error.message).toBe('Network Error'); |
2092 | 2092 | expect(failedMessage.error.status).toBe(0); |
2093 | 2093 | expect(failedMessage.error.code).toBeNull(); |
|
0 commit comments