sentry-native icon indicating copy to clipboard operation
sentry-native copied to clipboard

sentry example code in document is not working

Open m0hadang opened this issue 4 years ago • 2 comments

Description

When does the problem happen

  • [ ] During build
  • [x] During run-time
  • [ ] When capturing a hard crash

Environment

  • OS: Windows 10, 64-bit
  • Compiler: MSVC 19
  • CMake version and config: 0.4.11, SENTRY_BACKEND=crashpad

Steps To Reproduce

Log output


I tried before_send example in sentry native document, but not working as i expect

  • https://docs.sentry.io/platforms/native/configuration/filtering/#using-beforesend

1: How can i get exception information in before_send(crashpad) 1637047806 4032 exception is always null

2: How can i cancel sending report if I put "return NULL" code on before_send then compiler error so I put "return sentry_value_new_null()" code but still not working

m0hadang avatar Nov 16 '21 07:11 m0hadang

Regarding 1, it looks like you're trying to filter crashes via before_send. As noted in the docs in your link above, crashpad is notably a backend where before_send is not called before a crash is captured and reported: This is likely the reason why you're unable to find an exception in that callback.

The current lack of support for crashpad crashes in before_send ties into 2: crash filtering, or preventing reports related to crashes from being sent to sentry is currently not supported.

If I may ask, what sort of scenarios are you trying to handle with before_send? What're you interested in doing by canceling reports?

relaxolotl avatar Nov 18 '21 18:11 relaxolotl

I tested two type of sentry backend(crashpad, breakpad) and result is same

  • both before_send is invoked
  • both can't find out error information in before_send
  • both can't cancel error reporting in before_send At least i want to cancel error reporting in before_send.

I would like to implement the function for the user to proceed or cancel the error report when a crash occurs.

m0hadang avatar Nov 19 '21 02:11 m0hadang