Skip to content

improvement: error handling for zod validation failures in tools store #231

@DarianM

Description

@DarianM

Problem

File toolStore.tsx valtio store

  • saveConfig the action method stores invalid responses: when the API returns validation errors, the method still updates toolState.configurations with the response data, even if it contains error information instead of valid configurations due to zod failing validations
  • No structured error handling: Zod validation errors from the server are not properly parsed or surfaced to the user
  • Silent failures: users don't receive clear feedback about what validation rules failed
  • State corruption: invalid data may be stored in the application state

Expected Behavior

  • Parse API response structure: differentiate between success responses (valid configs) and error responses (validation failures)
  • Extract Zod error details: parse server-side validation errors into a user-friendly format
  • Preserve application state: don't update configurations when validation fails
  • Surface validation feedback: show specific field errors to help users fix their input, to allow users to retry after fixing validation issues (only if/where this could be possible)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions