|
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, |
@@ -2057,7 +2057,7 @@ describe('Channel', () => { |
2057 | 2057 | expect(msg.status).toBe('received'); |
2058 | 2058 | }); |
2059 | 2059 |
|
2060 | | - it('should convert axios network errors to ErrorFromResponse when sending fails', async () => { |
| 2060 | + it('should convert axios network errors to StreamAPIError when sending fails', async () => { |
2061 | 2061 | const messageText = nanoid(); |
2062 | 2062 | const messageId = nanoid(); |
2063 | 2063 | const axiosNetworkError = Object.assign(new Error('Network Error'), { |
@@ -2091,7 +2091,7 @@ describe('Channel', () => { |
2091 | 2091 | const failedMessage = channel.state.findMessage(messageId); |
2092 | 2092 | expect(failedMessage).toBeDefined(); |
2093 | 2093 | expect(failedMessage.status).toBe('failed'); |
2094 | | - expect(failedMessage.error).toBeInstanceOf(ErrorFromResponse); |
| 2094 | + expect(failedMessage.error).toBeInstanceOf(StreamAPIError); |
2095 | 2095 | expect(failedMessage.error.message).toBe('Network Error'); |
2096 | 2096 | expect(failedMessage.error.status).toBe(0); |
2097 | 2097 | expect(failedMessage.error.code).toBeNull(); |
|
0 commit comments