wsp-ms-core 1.1.22 → 1.1.23

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
@@ -2151,9 +2151,10 @@ var DefaultMysqlInboxRunner = class {
2151
2151
 
2152
2152
  // src/infrastructure/runners/default-mysql-inbox-processor.ts
2153
2153
  var DefaultMysqlInboxProcessor = class {
2154
- constructor(uowFactory) {
2154
+ constructor(uowFactory, onError) {
2155
2155
  this.uovFactory = uowFactory;
2156
2156
  this.handlers = /* @__PURE__ */ new Map();
2157
+ this.onError = onError;
2157
2158
  }
2158
2159
  async sleep() {
2159
2160
  return new Promise((r) => setTimeout(r, 5e3));
@@ -2175,6 +2176,13 @@ var DefaultMysqlInboxProcessor = class {
2175
2176
  record.markProcessed();
2176
2177
  } catch (error) {
2177
2178
  record.markWithError(error.toString());
2179
+ if (this.onError) {
2180
+ try {
2181
+ this.onError(record, error);
2182
+ } catch (handlerError) {
2183
+ console.error("Error dentro del onError handler:", handlerError);
2184
+ }
2185
+ }
2178
2186
  } finally {
2179
2187
  await repository.update(record);
2180
2188
  }