@xeno-js/core 4.1.2 → 4.1.3

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
@@ -977,7 +977,23 @@ var LoggerUtils = Object.freeze({
977
977
  },
978
978
  messaging: ctx?.messaging
979
979
  };
980
- return import_shared32.StringHelper.safeStringify(context);
980
+ return import_shared32.StringHelper.safeStringifyObject(context);
981
+ },
982
+ toNormalizeError(error) {
983
+ if (error instanceof Error) {
984
+ return {
985
+ message: error.message,
986
+ name: error.name,
987
+ stack: error.stack,
988
+ cause: error.cause
989
+ };
990
+ }
991
+ const errorString = import_shared32.Guards.isString(error) ? error : import_shared32.StringHelper.safeStringify(error);
992
+ const customError = new Error(errorString);
993
+ if (import_shared32.Guards.isObject(error) && import_shared32.Guards.isDefined(error)) {
994
+ Object.assign(customError, error);
995
+ }
996
+ return customError;
981
997
  }
982
998
  });
983
999