mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
refactor: return 500 http code in case of error
This commit is contained in:
parent
71946de478
commit
ab5124e851
1 changed files with 6 additions and 5 deletions
|
|
@ -160,11 +160,12 @@ const adminActionController: AppController = async (c) => {
|
||||||
}
|
}
|
||||||
if (data.type === 'revoke_name') {
|
if (data.type === 'revoke_name') {
|
||||||
n.revoke_name = true;
|
n.revoke_name = true;
|
||||||
relay.remove?.([{ kinds: [30360], authors: [await conf.signer.getPublicKey()], '#p': [authorId] }]).catch(
|
try {
|
||||||
(e: unknown) => {
|
await relay.remove!([{ kinds: [30360], authors: [await conf.signer.getPublicKey()], '#p': [authorId] }]);
|
||||||
logi({ level: 'error', ns: 'ditto.api.admin.account.action', type: data.type, error: errorJson(e) });
|
} catch (e) {
|
||||||
},
|
logi({ level: 'error', ns: 'ditto.api.admin.account.action', type: data.type, error: errorJson(e) });
|
||||||
);
|
return c.json({ error: 'Unexpected runtime error' }, 500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await updateUser(authorId, n, c);
|
await updateUser(authorId, n, c);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue