clean up error handling in add modal
This commit is contained in:
parent
a4572df406
commit
a580f179e1
1 changed files with 4 additions and 2 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue