How to use the mergeContext function from raven

Find comprehensive JavaScript raven.mergeContext code examples handpicked from public code repositorys.

54
55
56
57
58
59
60
61
62
63
req.user = req.user || {}
const token = req.headers['access-token']
const { id: userId } = jwtDecode(token, { secret })
raven.setContext({})
try {
  raven.mergeContext({
    user: { id: userId },
    tags: {
      component: 'api',
      platform: toLower(get(req, 'headers.platform')),
fork icon3
star icon5
watch icon0

+ 3 other calls in file

15
16
17
18
19
20
21
22
23
24
} else {
  Raven.context(contextRunInBackground)
}

async function contextRunInBackground () {
  Raven.mergeContext({ req: ctx.request })
  // use app.toAsyncFunction to support both generator function and async function
  try {
    await ctx.app.toAsyncFunction(scope)(ctx)
    ctx.coreLogger.info('[egg:background] task:%s success (%dms)', taskName, Date.now() - start)
fork icon0
star icon0
watch icon9

+ 3 other calls in file