Add additional logging for persistence failure

This commit is contained in:
Tom Moor 2021-09-18 20:09:08 -07:00
parent be64c2b206
commit 313067ff7b
1 changed files with 12 additions and 5 deletions

View File

@ -59,11 +59,18 @@ export default class Persistence {
Logger.info("database", `Persisting ${documentId}`);
await documentUpdater({
documentId,
ydoc: document,
userId: context.user.id,
});
try {
await documentUpdater({
documentId,
ydoc: document,
userId: context.user.id,
});
} catch (err) {
Logger.error("Unable to persist document", err, {
documentId,
userId: context.user?.id,
});
}
},
DELAY,
{