Fix not matching all errors in catch block

This commit is contained in:
Cadence Ember 2024-09-22 15:43:02 +12:00
parent b6c23c30fb
commit f3eb1fbeb3

View file

@ -30,7 +30,7 @@ async function emojisToState(emojis) {
} }
db.prepare("INSERT OR IGNORE INTO emoji (emoji_id, name, animated, mxc_url) VALUES (?, ?, ?, ?)").run(emoji.id, emoji.name, +!!emoji.animated, url) db.prepare("INSERT OR IGNORE INTO emoji (emoji_id, name, animated, mxc_url) VALUES (?, ?, ?, ?)").run(emoji.id, emoji.name, +!!emoji.animated, url)
}).catch(e => { }).catch(e => {
if (e.data.errcode === "M_TOO_LARGE") { // Very unlikely to happen. Only possible for 3x-series emojis uploaded shortly after animated emojis were introduced, when there was no 256 KB size limit. if (e.data?.errcode === "M_TOO_LARGE") { // Very unlikely to happen. Only possible for 3x-series emojis uploaded shortly after animated emojis were introduced, when there was no 256 KB size limit.
return return
} }
console.error(`Trying to handle emoji ${emoji.name} (${emoji.id}), but...`) console.error(`Trying to handle emoji ${emoji.name} (${emoji.id}), but...`)