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
|
open = false
|
||||||
onOpenChange?.(false)
|
onOpenChange?.(false)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Only log non-cancellation errors
|
// Log all errors except cancellation
|
||||||
if (error && typeof error === 'object' && 'name' in error && error.name !== 'CancelledError') {
|
const isCancelledError =
|
||||||
|
error && typeof error === 'object' && 'name' in error && error.name === 'CancelledError'
|
||||||
|
if (!isCancelledError) {
|
||||||
console.error(`Failed to add ${entityNames[currentEntityType].plural}:`, error)
|
console.error(`Failed to add ${entityNames[currentEntityType].plural}:`, error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue