function handleFetchError()

in newswires/client/src/context/SearchContext.tsx [147:156]


	function handleFetchError(error: ErrorEvent) {
		if (error instanceof Error) {
			// we don't want to treat aborts as errors
			if (error.name !== 'AbortError') {
				dispatch({ type: 'FETCH_ERROR', error: error.message });
			}
		} else {
			dispatch({ type: 'FETCH_ERROR', error: 'unknown error' });
		}
	}