mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05: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:
parent
dac4d64716
commit
60dbcdd08e
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue