MCPcopy Index your code
hub / github.com/simstudioai/sim / notifyRowWriteError

Function notifyRowWriteError

apps/sim/hooks/queries/tables.ts:615–624  ·  view source on GitHub ↗

* Toasts a failed row write. A plan row-limit failure (the best-effort cap in * `assertRowCapacity`) gets an "Upgrade" action routing to the explore-plans page; * other errors are a plain auto-dismissing toast. Validation errors are surfaced * inline, not here.

(error: Error, onUpgrade: () => void)

Source from the content-addressed store, hash-verified

613 * inline, not here.
614 */
615function notifyRowWriteError(error: Error, onUpgrade: () => void): void {
616 if (isValidationError(error)) return
617 if (error.message.toLowerCase().includes('row limit')) {
618 toast.error(error.message, {
619 action: { label: 'Upgrade', onClick: onUpgrade },
620 })
621 return
622 }
623 toast.error(error.message, { duration: 5000 })
624}
625
626export function useCreateTableRow({ workspaceId, tableId }: RowMutationContext) {
627 const queryClient = useQueryClient()

Callers 2

useCreateTableRowFunction · 0.85
useBatchCreateTableRowsFunction · 0.85

Calls 2

isValidationErrorFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected