Skip to content

Commit

Permalink
Merge pull request #6495 from nextcloud/backport/6490/stable29
Browse files Browse the repository at this point in the history
[stable29] fix(sync): handle 502 (Bad Gateway) gracefully
  • Loading branch information
max-nextcloud authored Oct 2, 2024
2 parents ffa4678 + c6075b2 commit 86d3d69
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/services/PollingBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,10 @@ class PollingBackend {
} else if (e.response.status === 412) {
this.#syncService.emit('error', { type: ERROR_TYPE.LOAD_ERROR, data: e.response })
this.disconnect()
} else if (e.response.status === 403) {
} else if ([403, 404].includes(e.response.status)) {
this.#syncService.emit('error', { type: ERROR_TYPE.SOURCE_NOT_FOUND, data: {} })
this.disconnect()
} else if (e.response.status === 404) {
this.#syncService.emit('error', { type: ERROR_TYPE.SOURCE_NOT_FOUND, data: {} })
this.disconnect()
} else if (e.response.status === 503) {
} else if ([502, 503].includes(e.response.status)) {
this.increaseRefetchTimer()
this.#syncService.emit('error', { type: ERROR_TYPE.CONNECTION_FAILED, data: {} })
logger.error('Failed to fetch steps due to unavailable service', { error: e })
Expand Down

0 comments on commit 86d3d69

Please sign in to comment.