@nsshunt/ststestrunner 1.0.32 → 1.0.33
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/ststestrunner.mjs
CHANGED
|
@@ -20356,7 +20356,18 @@ 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
|
-
|
|
20359
|
+
console.log(args);
|
|
20360
|
+
const cb = args.at(-1);
|
|
20361
|
+
const inputArgs = args.slice(0, -1);
|
|
20362
|
+
try {
|
|
20363
|
+
const result = await handler(...inputArgs);
|
|
20364
|
+
__privateGet(this, _debug5).call(this, chalk$1.yellow(`${logPrefix} --> ${event}: ${JSON.stringify(args, null, 2)} = [${JSON.stringify(result, null, 2)}]`));
|
|
20365
|
+
cb(__privateGet(this, _EmitEvent).call(this, event, result));
|
|
20366
|
+
} catch (err) {
|
|
20367
|
+
__privateGet(this, _error2).call(this, `${logPrefix} error in ${event}: ${err}`);
|
|
20368
|
+
__privateGet(this, _error2).call(this, chalk$1.red(`${logPrefix} --> ${event}: ${JSON.stringify(args, null, 2)} = Error: [${err}]`));
|
|
20369
|
+
cb({ error: err instanceof Error ? err.message : String(err) });
|
|
20370
|
+
}
|
|
20360
20371
|
} else {
|
|
20361
20372
|
__privateGet(this, _debug5).call(this, chalk$1.yellow(`${logPrefix} --> ${event}: ${JSON.stringify(args, null, 2)}`));
|
|
20362
20373
|
return handler(...args);
|