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/index.js CHANGED
@@ -2708,7 +2708,7 @@ export class DDB {
2708
2708
  this.streaming.table,
2709
2709
  (this.streaming.action ||= `api_js_${new Date().getTime()}`),
2710
2710
  ...this.streaming?.filters?.column ? [
2711
- new DdbVoid(),
2711
+ new DdbVoid(), // offset
2712
2712
  this.streaming.filters.column // filter
2713
2713
  ] : []
2714
2714
  ], {
@@ -2720,6 +2720,12 @@ export class DDB {
2720
2720
  const i_topic_end = buffer.indexOf(0, 17);
2721
2721
  // 首个 message 一定是 table schema, 后续消息是 column 片段组成的 any vector
2722
2722
  const data = DdbObj.parse(buffer.subarray(i_topic_end + 1), this.le);
2723
+ // server 推数据时遇到错误会返回 string,一般格式为 error.xxx: 错误信息
2724
+ if (data.form === DdbForm.scalar && data.type === DdbType.string) {
2725
+ this.disconnect();
2726
+ const value = data.value;
2727
+ throw new Error(value.slice(value.indexOf(':') + 1).trim());
2728
+ }
2723
2729
  if (!schema) {
2724
2730
  schema = data;
2725
2731
  return;