1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-18 02:23:12 +02:00

Reserved topic stuff

This commit is contained in:
binwiederhier 2023-01-04 20:34:22 -05:00
parent 6c0429351a
commit a91da7cf2c
11 changed files with 240 additions and 133 deletions
web/src/app

View file

@ -231,6 +231,8 @@ class AccountApi {
});
if (response.status === 401 || response.status === 403) {
throw new UnauthorizedError();
} else if (response.status === 409) {
throw new TopicReservedError();
} else if (response.status !== 200) {
throw new Error(`Unexpected server response ${response.status}`);
}
@ -312,6 +314,13 @@ export class UsernameTakenError extends Error {
}
}
export class TopicReservedError extends Error {
constructor(topic) {
super("Topic already reserved");
this.topic = topic;
}
}
export class AccountCreateLimitReachedError extends Error {
constructor() {
super("Account creation limit reached");