mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2026-01-03 04:41:13 +00:00
Handle user not found in assistant
This commit is contained in:
@@ -26,9 +26,14 @@ class Assistant {
|
||||
if (root.status === "ok") {
|
||||
this.lastRequestStatus = constants.symbols.assistant_statuses.OK
|
||||
resolve(root.data.user)
|
||||
} else {
|
||||
this.lastRequestStatus = constants.symbols.assistant_statuses.BLOCKED
|
||||
reject(constants.symbols.assistant_statuses.BLOCKED)
|
||||
} else { // "fail"
|
||||
if (root.identifier === "NOT_FOUND") {
|
||||
this.lastRequestStatus = constants.symbols.assistant_statuses.OK
|
||||
reject(constants.symbols.NOT_FOUND)
|
||||
} else { // blocked
|
||||
this.lastRequestStatus = constants.symbols.assistant_statuses.BLOCKED
|
||||
reject(constants.symbols.assistant_statuses.BLOCKED)
|
||||
}
|
||||
}
|
||||
}).catch(error => {
|
||||
// console.error(error)
|
||||
|
||||
Reference in New Issue
Block a user