});
Set a global tag
_Old_:
js
Raven.setTagsContext({ key: 'value' });
_New_:
js
Sentry.configureScope((scope) => {
scope.setTag('key', 'value');
});
Capture custom exception
_Old_:
js
try {
throwingFunction();
} catch (e) {
Raven.captureException(e, { extra: { debug: false } });
}
_New_:
js
try {
throwingFunction();
} catch (e) {
Sentry.withScope((scope) => {
scope.setExtra('debug', false);
Sentry.captureException(e);
});
}
Capture a message
_Old_:
js
Raven.captureMessage('test', 'info', { extra: { debug: false } });
_New_:
js
Sentry.withScope((scope) => {
scope.setExtra('debug', false);
Sentry.captureMessage('test', 'info');
});
Breadcrumbs
_Old_:
js
Raven.captureBreadcrumb({
message: 'Item added to shopping cart',
category: 'action',
data: {
isbn: '978-1617290541',
cartSize: '3',
},
});
_New_:
js
Sentry.addBreadcrumb({
message: 'Item added to shopping cart',
category: 'action',
data: {
isbn: '978-1617290541',
cartSize: '3',
},
});