dolphindb 2.0.1032 → 2.0.1034

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/browser.js CHANGED
@@ -2709,7 +2709,7 @@ export class DDB {
2709
2709
  this.streaming.table,
2710
2710
  (this.streaming.action ||= `api_js_${new Date().getTime()}`),
2711
2711
  ...this.streaming?.filters?.column ? [
2712
- new DdbVoid(),
2712
+ new DdbVoid(), // offset
2713
2713
  this.streaming.filters.column // filter
2714
2714
  ] : []
2715
2715
  ], {
@@ -2721,6 +2721,12 @@ export class DDB {
2721
2721
  const i_topic_end = buffer.indexOf(0, 17);
2722
2722
  // 首个 message 一定是 table schema, 后续消息是 column 片段组成的 any vector
2723
2723
  const data = DdbObj.parse(buffer.subarray(i_topic_end + 1), this.le);
2724
+ // server 推数据时遇到错误会返回 string,一般格式为 error.xxx: 错误信息
2725
+ if (data.form === DdbForm.scalar && data.type === DdbType.string) {
2726
+ this.disconnect();
2727
+ const value = data.value;
2728
+ throw new Error(value.slice(value.indexOf(':') + 1).trim());
2729
+ }
2724
2730
  if (!schema) {
2725
2731
  schema = data;
2726
2732
  return;