wsp-ms-core 1.0.89 → 1.0.90

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
@@ -1841,22 +1841,18 @@ var DefaultMysqlInboxRunner = class {
1841
1841
  this.eventManager = eventManager;
1842
1842
  }
1843
1843
  async saveEvent(e, repository) {
1844
- let record = new InboxRecord(
1845
- UUID.create(),
1846
- e.tenant,
1847
- e.topic,
1848
- e.producer,
1849
- JSON.stringify(e.message),
1850
- ProcessStatus.PENDING
1851
- );
1852
1844
  try {
1845
+ let record = new InboxRecord(
1846
+ UUID.create(),
1847
+ e.tenant,
1848
+ e.topic,
1849
+ e.producer,
1850
+ JSON.stringify(e.message),
1851
+ ProcessStatus.PENDING
1852
+ );
1853
1853
  await repository.create(record);
1854
1854
  } catch (error) {
1855
- const type = String(error.type);
1856
- record.markWithError(type);
1857
- throw new Error(type);
1858
- } finally {
1859
- await repository.update(record);
1855
+ throw new Error(String(error.type));
1860
1856
  }
1861
1857
  }
1862
1858
  subscribeTo(topic) {
@@ -1871,6 +1867,9 @@ var DefaultMysqlInboxRunner = class {
1871
1867
  this.eventManager.onMessage((data) => {
1872
1868
  console.log(data);
1873
1869
  });
1870
+ this.eventManager.onError((data) => {
1871
+ console.log(data);
1872
+ });
1874
1873
  this.eventManager.route(topic, async (e) => {
1875
1874
  await this.saveEvent(e, new InboxMysqlRepository(await this.databaseConnector.getConnection()));
1876
1875
  });