wsp-ms-core 1.0.89 → 1.0.91

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,19 @@ 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
+ console.log(error);
1929
+ throw error;
1933
1930
  }
1934
1931
  }
1935
1932
  subscribeTo(topic) {
@@ -1944,6 +1941,9 @@ var DefaultMysqlInboxRunner = class {
1944
1941
  this.eventManager.onMessage((data) => {
1945
1942
  console.log(data);
1946
1943
  });
1944
+ this.eventManager.onError((data) => {
1945
+ console.log(data);
1946
+ });
1947
1947
  this.eventManager.route(topic, async (e) => {
1948
1948
  await this.saveEvent(e, new InboxMysqlRepository(await this.databaseConnector.getConnection()));
1949
1949
  });