Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("Able to make exception calls", () => {
const fieldObject: ga.FieldsObject = {
page: '/users'
};
ga.exception(fieldObject);
});
it("Able to make plugin object calls", () => {
export function trackError(description: string) {
if (isGaEnabled) {
let msg = description;
if (!/^jaeger/i.test(msg)) {
msg = `jaeger/${msg}`;
}
msg = msg.slice(0, 149);
ReactGA.exception({ description: msg, fatal: false });
if (isDebugMode) {
logTrackingCalls();
}
}
}
export function trackError(description: string) {
if (isGaEnabled) {
let msg = description;
if (!/^jaeger/i.test(msg)) {
msg = `jaeger/${msg}`;
}
msg = msg.slice(0, 149);
ReactGA.exception({ description: msg, fatal: false });
if (isDebugMode) {
logTrackingCalls();
}
}
}
.catch(err => {
this.setState({
resultsError: err,
resultsPromiseState: 'rejected',
})
console.error(err)
Analytics.event({
category: 'Search',
action: 'Search Failure',
label: packageString.replace(/@/g, '[at]'),
})
Analytics.exception({
description: err.error ? err.error.code : err.toString(),
})
})
}
export const logException = (description = '', fatal = false) => {
if (description) {
ReactGA.exception({ description, fatal });
}
};
const sendException = (event) => {
let message;
if (event.type === 'unhandledrejection') {
message = `UNHANDLED REJECTION: ${JSON.stringify(event.reason, Object.getOwnPropertyNames(event.reason))}`;
} else {
message = `ERROR: ${JSON.stringify(event, Object.getOwnPropertyNames(event))}`;
}
ReactGA.exception({
description: message,
});
};
showInvalidFileError() {
alert('Could not parse the `package.json` file.')
Analytics.exception({
description: 'Could not parse the `package.json` file',
})
}
export const logException = (description = '', fatal = false) => {
if (description) {
ReactGA.exception({ description, fatal })
}
}
export const logException = (description = "", fatal = false) => {
if (description) {
ReactGA.exception({ description, fatal });
}
};