(errorType?: DevtoolsErrorType)
| 1879 | } |
| 1880 | |
| 1881 | const triggerError = (errorType?: DevtoolsErrorType) => { |
| 1882 | const activeQueryVal = activeQuery() |
| 1883 | if (!activeQueryVal) return |
| 1884 | sendDevToolsEvent({ |
| 1885 | type: 'TRIGGER_ERROR', |
| 1886 | queryHash: activeQueryVal.queryHash, |
| 1887 | metadata: { error: errorType?.name }, |
| 1888 | }) |
| 1889 | const error = |
| 1890 | errorType?.initializer(activeQueryVal) ?? |
| 1891 | new Error('Unknown error from devtools') |
| 1892 | |
| 1893 | const __previousQueryOptions = activeQueryVal.options |
| 1894 | |
| 1895 | activeQueryVal.setState({ |
| 1896 | status: 'error', |
| 1897 | error, |
| 1898 | fetchMeta: { |
| 1899 | ...activeQueryVal.state.fetchMeta, |
| 1900 | __previousQueryOptions, |
| 1901 | } as any, |
| 1902 | } as QueryState<unknown, Error>) |
| 1903 | } |
| 1904 | |
| 1905 | const restoreQueryAfterLoadingOrError = () => { |
| 1906 | const activeQueryVal = activeQuery() |
no test coverage detected
searching dependent graphs…