@nsshunt/ststestrunner 1.0.32 → 1.0.34

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.
@@ -20356,7 +20356,24 @@ class ServiceInstance {
20356
20356
  const wrappedHandler = async (...args) => {
20357
20357
  if (typeof args.at(-1) === "function") {
20358
20358
  __privateGet(this, _debug5).call(this, chalk$1.yellow(`${logPrefix} --> ${event} (with callback): ${JSON.stringify(args, null, 2)}`));
20359
- return handler(...args);
20359
+ console.log(args);
20360
+ const cb = args.at(-1);
20361
+ const inputArgs = args.slice(0, -1);
20362
+ try {
20363
+ console.log(`Before result call...`);
20364
+ const result = await handler(...inputArgs);
20365
+ console.log(`After result call...`);
20366
+ console.log(result);
20367
+ __privateGet(this, _debug5).call(this, chalk$1.yellow(`${logPrefix} --> ${event}: ${JSON.stringify(args, null, 2)} = [${JSON.stringify(result, null, 2)}]`));
20368
+ const res = __privateGet(this, _EmitEvent).call(this, event, result);
20369
+ console.log(`res...`);
20370
+ console.log(res);
20371
+ cb(res);
20372
+ } catch (err) {
20373
+ __privateGet(this, _error2).call(this, `${logPrefix} error in ${event}: ${err}`);
20374
+ __privateGet(this, _error2).call(this, chalk$1.red(`${logPrefix} --> ${event}: ${JSON.stringify(args, null, 2)} = Error: [${err}]`));
20375
+ cb({ error: err instanceof Error ? err.message : String(err) });
20376
+ }
20360
20377
  } else {
20361
20378
  __privateGet(this, _debug5).call(this, chalk$1.yellow(`${logPrefix} --> ${event}: ${JSON.stringify(args, null, 2)}`));
20362
20379
  return handler(...args);