Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(sync): handle 502 (Bad Gateway) gracefully
This is the proxies response when the request to the server fails.
It is often temporary - so it makes sense to keep trying.

Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud committed Oct 2, 2024
commit c8c8b5dc06acc1b9874b85fbbcef8b2d1d6955c3
7 changes: 2 additions & 5 deletions src/services/PollingBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,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