ReviewOS

craft-native/craft

fix(types): align CraftErrorCode with native bridge errors

#266
Closed glennmichael123 opened this 9 days ago ·
9 days ago

Split out of #242.

packages/typescript/types/craft.d.ts declares CraftErrorCode using an older vocabulary such as INVALID_PARAMS, NOT_AVAILABLE, and STORAGE_FULL. The native bridge currently emits a different public string vocabulary from bridge_error.BridgeError, including INVALID_PARAMETER, PLATFORM_NOT_SUPPORTED, NATIVE_CALL_FAILED, and now BUSY.

This makes the declaration misleading for applications that inspect error.code, and adding only BUSY would preserve the larger mismatch.

Suggested scope

  • Establish one source of truth for native bridge error-code strings.
  • Align or generate the public TypeScript declaration from that source.
  • Add a parity test so the Zig and TypeScript vocabularies cannot silently drift.
  • Document compatibility implications for existing applications using the older names.

Kept out of #242 so that issue remains the focused iOS pool-exhaustion behavior fix.

Sign in to comment on this issue.