Skip to content

Commit

Permalink
frontend/devices: Fix unused retry API error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrisan committed Jan 28, 2024
1 parent dc00ede commit b9db505
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qtoggleserver/frontend/js/devices/add-device-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ class AddDeviceForm extends PageForm {
}).catch(function (error) {

/* Retry with /api path, which should be a default location for qToggleServer implementations */
if (error instanceof BaseAPI.APIError && error.status === 404 && url.path === '/') {
if (error instanceof BaseAPI.APIError && url.path === '/' &&
(error.status === 404 || RETRY_API_ERROR_CODES.indexOf(error.code) >= 0)) {
logger.debug('retrying with /api suffix')
url.path = '/api'
data.url = url.toString()
Expand Down

0 comments on commit b9db505

Please sign in to comment.