Files
chenxingyang1019 ec882dd682 feat(apps): friendly error for db commands on an app with no database (#2162)
* feat(apps): friendly error for db commands on an app with no database

Server code 500002759 (a db command run against an app that has not
initialized a database yet) previously surfaced with an internal-term
message and no actionable next step.

withAppsHint now special-cases this code: it rewrites the message to a
user-facing "this app does not have a database yet" and forces a
cloud-development recovery hint (session-list/create -> chat -> poll
session-get -> retry). Because every apps db command funnels through
withAppsHint and this code is db-endpoint-specific, the whole db command
family is covered without per-command changes.

* fix(apps): generalize no-database retry hint and harden its test

Address review feedback on the no-database (500002759) recovery hint:

- The hint's final step named `+db-table-list` specifically, which would
  redirect the operation when a different db command triggered it. Replace
  it with "retry the original db command" so the recovery flow always
  resumes whatever the caller ran.
- Strengthen the unit test to assert the helper returns the same error
  value (cause chain preserved) and leaves Category/Subtype/Code intact,
  not just the rewritten Message/Hint.
2026-08-04 11:53:37 +08:00
..