"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.trackError = void 0;
var _dataSources = require("@mirai/data-sources");
var _Core = require("../Core.constants");
const trackError = (errorMessage, errorStack) => {
  if (typeof errorMessage !== 'string' || errorMessage.trim() === '') return;
  _dataSources.Event.publish(_Core.EVENT.METRICS, {
    id: 'ERROR:CORE',
    errorMessage,
    errorStack: errorStack ? typeof errorStack === 'object' ? JSON.stringify(errorStack) : String(errorStack) : undefined
  });
};
exports.trackError = trackError;
//# sourceMappingURL=trackError.js.map