UNPKG

@datadog/browser-logs

Version:
17 lines 725 B
import { ErrorSource, addTelemetryDebug } from '@datadog/browser-core'; import { StatusType } from './logger/isAuthorized'; export function startReportError(lifeCycle) { return (error) => { lifeCycle.notify(0 /* LifeCycleEventType.RAW_LOG_COLLECTED */, { rawLogsEvent: { message: error.message, date: error.startClocks.timeStamp, origin: ErrorSource.AGENT, status: StatusType.error, }, }); // monitor-until: forever, to keep an eye on the errors reported to customers addTelemetryDebug('Error reported to customer', { 'error.message': error.message }); }; } //# sourceMappingURL=reportError.js.map