clean up error handling in add modal

This commit is contained in:
Justin Edmund 2025-12-03 10:51:17 -08:00
parent a4572df406
commit a580f179e1

View file

@ -264,8 +264,10 @@
open = false
onOpenChange?.(false)
} catch (error) {
// Only log non-cancellation errors
if (error && typeof error === 'object' && 'name' in error && error.name !== 'CancelledError') {
// Log all errors except cancellation
const isCancelledError =
error && typeof error === 'object' && 'name' in error && error.name === 'CancelledError'
if (!isCancelledError) {
console.error(`Failed to add ${entityNames[currentEntityType].plural}:`, error)
}
}