mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 02:00:10 +02:00
Merge pull request #14648 from overleaf/jdt-hist-req-errors
swallow abort error on parse fail if specified GitOrigin-RevId: b2c049171e9a0c8bc5869a7ef7498134f8964318
This commit is contained in:
@@ -153,6 +153,11 @@ function fetchJSON<T>(
|
||||
}
|
||||
},
|
||||
error => {
|
||||
// swallow the error if the fetch was cancelled (e.g. by cancelling an AbortController on component unmount)
|
||||
if (swallowAbortError && error.name === 'AbortError') {
|
||||
// the fetch request was aborted while reading/parsing the response body
|
||||
return
|
||||
}
|
||||
// parsing the response body failed
|
||||
reject(
|
||||
new FetchError(
|
||||
@@ -168,6 +173,7 @@ function fetchJSON<T>(
|
||||
error => {
|
||||
// swallow the error if the fetch was cancelled (e.g. by cancelling an AbortController on component unmount)
|
||||
if (swallowAbortError && error.name === 'AbortError') {
|
||||
// the fetch request was aborted before a response was returned
|
||||
return
|
||||
}
|
||||
// the fetch failed
|
||||
|
||||
Reference in New Issue
Block a user