@mastra/cloudflare-d1 1.2.0 → 1.3.0-alpha.0

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/dist/index.js CHANGED
@@ -1205,13 +1205,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
1205
1205
  }, error);
1206
1206
  this.logger?.error(mastraError.toString());
1207
1207
  this.logger?.trackException(mastraError);
1208
- return {
1209
- threads: [],
1210
- total: 0,
1211
- page,
1212
- perPage: perPageForResponse,
1213
- hasMore: false
1214
- };
1208
+ throw mastraError;
1215
1209
  }
1216
1210
  }
1217
1211
  async saveThread({ thread }) {
@@ -1637,6 +1631,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
1637
1631
  hasMore: metadataFilter ? perPageInput !== false && offset + paginatedCount < total : perPageInput !== false && !allThreadMessagesReturned && offset + perPage < total
1638
1632
  };
1639
1633
  } catch (error) {
1634
+ if (error instanceof MastraError && error.category === ErrorCategory.USER) throw error;
1640
1635
  const mastraError = new MastraError({
1641
1636
  id: createStorageErrorId("CLOUDFLARE_D1", "LIST_MESSAGES", "FAILED"),
1642
1637
  domain: ErrorDomain.STORAGE,
@@ -1649,13 +1644,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
1649
1644
  }, error);
1650
1645
  this.logger?.error?.(mastraError.toString());
1651
1646
  this.logger?.trackException?.(mastraError);
1652
- return {
1653
- messages: [],
1654
- total: 0,
1655
- page,
1656
- perPage: perPageForResponse,
1657
- hasMore: false
1658
- };
1647
+ throw mastraError;
1659
1648
  }
1660
1649
  }
1661
1650
  async updateMessages(args) {