Skip to content

Commit 9933829

Browse files
committed
handle 409
1 parent be2afa4 commit 9933829

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

  • packages/web-console/src/utils/questdb

packages/web-console/src/utils/questdb/client.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,18 @@ export class Client {
434434
body: JSON.stringify(prefs),
435435
},
436436
)
437+
if (response.status === 409) {
438+
throw new Error("Instance information is changed since the last update. Please try again.")
439+
}
437440
if (!response.ok) {
438-
throw new Error(response.statusText);
441+
let errorMessage: string
442+
try {
443+
const { error } = await response.json()
444+
errorMessage = error
445+
} catch (e) {
446+
errorMessage = response.statusText
447+
}
448+
throw new Error(errorMessage)
439449
}
440450
}
441451

0 commit comments

Comments
 (0)