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.cjs CHANGED
@@ -1914,22 +1914,18 @@ var DefaultMysqlInboxRunner = class {
1914
1914
  this.eventManager = eventManager;
1915
1915
  }
1916
1916
  async saveEvent(e, repository) {
1917
- let record = new InboxRecord(
1918
- UUID.create(),
1919
- e.tenant,
1920
- e.topic,
1921
- e.producer,
1922
- JSON.stringify(e.message),
1923
- ProcessStatus.PENDING
1924
- );
1925
1917
  try {
1918
+ let record = new InboxRecord(
1919
+ UUID.create(),
1920
+ e.tenant,
1921
+ e.topic,
1922
+ e.producer,
1923
+ JSON.stringify(e.message),
1924
+ ProcessStatus.PENDING
1925
+ );
1926
1926
  await repository.create(record);
1927
1927
  } catch (error) {
1928
- const type = String(error.type);
1929
- record.markWithError(type);
1930
- throw new Error(type);
1931
- } finally {
1932
- await repository.update(record);
1928
+ throw new Error(String(error.type));
1933
1929
  }
1934
1930
  }
1935
1931
  subscribeTo(topic) {
@@ -1944,6 +1940,9 @@ var DefaultMysqlInboxRunner = class {
1944
1940
  this.eventManager.onMessage((data) => {
1945
1941
  console.log(data);
1946
1942
  });
1943
+ this.eventManager.onError((data) => {
1944
+ console.log(data);
1945
+ });
1947
1946
  this.eventManager.route(topic, async (e) => {
1948
1947
  await this.saveEvent(e, new InboxMysqlRepository(await this.databaseConnector.getConnection()));
1949
1948
  });