Refactor to not use status: success, but HTTP codes, and renamed the error key to detail to match FastAPI's own.
This commit is contained in:
1 parent
c8bb2ab12e
commit
b255362946
6 files changed
+37
-39
No files matched your search
@@ -57,8 +57,8 @@ class AwaitableWebSocket extends WebSocket {
|
||||
console.error("Failed to parse JSON from WebSocket message", data, err)
|
||||
throw new Error("Failed to parse JSON from WebSocket message")
|
||||
}
|
||||
if (parsed.error) {
|
||||
throw new Error(`Server: ${parsed.error}`)
|
||||
if (parsed.detail) {
|
||||
throw new Error(`Server: ${parsed.detail}`)
|
||||
}
|
||||
return parsed
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user