Skip to content

fix: unhandled form validation rejection in EditModeModal (ELECTRON-1E) #1778

@kaizhou-lab

Description

@kaizhou-lab

Problem

In EditModeModal.tsx, the onOk handler calls await form.validate() without a try-catch.
When the user clicks Save with invalid form fields, Arco Form's validate() rejects with a
ValidateError, which propagates as an unhandled promise rejection.

Sentry Issue: ELECTRON-1E — 26 occurrences, active on v1.9.1

Root Cause

AionModal's OK button uses onClick={props.onOk} directly. When onOk is an async function
that returns a rejected promise, React's onClick does not catch it.

Fix

Wrap the onOk handler body in try-catch. The catch block is intentionally empty because
Arco Form automatically highlights invalid fields on validation failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions