Commit 88e57d4
fix(cubejs-client-core): surface cubeSql error chunks instead of dropping rows (cube-js#11097)
* fix(cubejs-client-core): surface cubeSql error chunks instead of dropping rows
The cubesql endpoint streams JSONL (schema line, then data lines), and on a
post-processing failure appends a trailing `{ error }` chunk. The non-streaming
`cubeSql()` parser mapped every non-schema line through `JSON.parse(d).data`,
so the error line became an `undefined` phantom row and the failure was
silently swallowed — callers saw a "successful" result with a null row.
Classify each line and throw on an `error` chunk, mirroring how
`cubeSqlStream()` already handles it. Genuine parse failures still fall back to
the raw response body.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(cubejs-client-core): satisfy eslint in cubeSql error handling
Drop the `no-continue` violation by inverting the loop guard, and switch
the regression test's error strings to single quotes per the lint rule.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 3eae361 commit 88e57d4
2 files changed
Lines changed: 70 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
| 789 | + | |
789 | 790 | | |
790 | | - | |
791 | | - | |
792 | | - | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | | - | |
797 | | - | |
798 | | - | |
| 791 | + | |
799 | 792 | | |
| 793 | + | |
800 | 794 | | |
801 | 795 | | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
802 | 830 | | |
803 | 831 | | |
804 | 832 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
430 | 445 | | |
431 | 446 | | |
432 | 447 | | |
| |||
471 | 486 | | |
472 | 487 | | |
473 | 488 | | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
474 | 507 | | |
475 | 508 | | |
476 | 509 | | |
| |||
0 commit comments