getConfigs: wrap in try-catch
This commit is contained in:
parent
dffa70e2fe
commit
9c4301e791
|
@ -72,9 +72,12 @@ async function getConfigs(signal: AbortSignal): Promise<PleromaConfig[]> {
|
||||||
limit: 1,
|
limit: 1,
|
||||||
}], { signal });
|
}], { signal });
|
||||||
|
|
||||||
return jsonSchema.pipe(configSchema.array()).catch([]).parse(
|
try {
|
||||||
await new AdminSigner().nip44.decrypt(Conf.pubkey, event.content).catch(() => ''),
|
const decrypted = await new AdminSigner().nip44.decrypt(Conf.pubkey, event.content);
|
||||||
);
|
return jsonSchema.pipe(configSchema.array()).catch([]).parse(decrypted);
|
||||||
|
} catch (_e) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { configController, frontendConfigController, pleromaAdminDeleteStatusController, updateConfigController };
|
export { configController, frontendConfigController, pleromaAdminDeleteStatusController, updateConfigController };
|
||||||
|
|
Loading…
Reference in New Issue