net-tech-
net-tech-
Explore posts from servers
DTDrizzle Team
Created by net-tech- on 10/7/2023 in #help
Alerting if there is conflict
I'm doing an insert and wanted to ask whether there is a specific error type that is returned when there is a conflict. Pseudo-code of what I would want
await db.insert(guild).values({ id: interaction.guildId })
.catch((error) => {
if (error.type === "conflict") {
alert("This already exists")
}
})
await db.insert(guild).values({ id: interaction.guildId })
.catch((error) => {
if (error.type === "conflict") {
alert("This already exists")
}
})
3 replies