Improve order history error debugging

Add detail and line number to error messages for easier troubleshooting.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-01-14 23:28:43 -08:00
parent d111833aab
commit e8c99844f8

View file

@ -965,7 +965,9 @@ class Api {
final j = _requireJson(raw, "GetOrderHistory"); final j = _requireJson(raw, "GetOrderHistory");
if (!_ok(j)) { if (!_ok(j)) {
throw StateError("GetOrderHistory failed: ${_err(j)}"); final detail = j["DETAIL"] ?? j["detail"] ?? "";
final debugLine = j["DEBUG_LINE"] ?? j["debug_line"] ?? "";
throw StateError("GetOrderHistory failed: ${_err(j)} - $detail (line: $debugLine)");
} }
final ordersJson = j["ORDERS"] as List<dynamic>? ?? []; final ordersJson = j["ORDERS"] as List<dynamic>? ?? [];