fix: improve database error message extraction for queries

- frontend: use e.message instead of String(e) in toErrorResult to avoid
  "Error: " prefix for HTTP-mode errors, matching connectionErrorMessage
- frontend: apply same fix to MongoDocBrowser error display
- backend(postgres): use pg_error_to_string across all query execution
  paths (execute, execute_batch, copy_out, copy_in) to extract DbError
  details instead of generic transport-layer errors

Other databases (MySQL, SQL Server, SQLite, DuckDB) already include
server-level error details in their native Error::to_string().
This commit is contained in:
t8y2 committed 2026-05-27 15:40:28 +08:00
1 parent 7717eae5ff
commit dafed47b07
3 files changed
+14 -13

No files matched your search

@@ -167,7 +167,7 @@ async function load() {
documents.value = result.documents.map(asRecord);
total.value = result.total;
} catch (e: unknown) {
error.value = String(e);
error.value = e instanceof Error ? e.message : String(e);
} finally {
loading.value = false;
}
@@ -354,7 +354,7 @@ async function saveDoc() {
editJson.value = JSON.stringify(documents.value[selectedIdx.value], null, 2);
}
} catch (e: unknown) {
error.value = String(e);
error.value = e instanceof Error ? e.message : String(e);
}
}
@@ -371,7 +371,7 @@ async function applyDeleteDoc(idx: number) {
}
await load();
} catch (e: unknown) {
error.value = String(e);
error.value = e instanceof Error ? e.message : String(e);
}
}