Exception on captureException() call
See original GitHub issueIs there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
SDK Version
7.11.1
Framework Version
No response
Link to Sentry event
No response
Steps to Reproduce
Catch exception, call captureException
.
Expected Result
Exception being reported to Sentry
Actual Result
/home/node/node_modules/@sentry/utils/cjs/misc.js:25
crypto && crypto.getRandomValues ? () => crypto.getRandomValues(new Uint8Array(1))[0] : () => Math.random() * 16;
^
TypeError: Cannot read properties of undefined (reading '0')
at /home/node/node_modules/@sentry/utils/cjs/misc.js:25:87
at /home/node/node_modules/@sentry/utils/cjs/misc.js:30:19
at String.replace (<anonymous>)
at Object.uuid4 (/home/node/node_modules/@sentry/utils/cjs/misc.js:29:46)
at Hub.captureException (/home/node/node_modules/@sentry/hub/cjs/hub.js:130:86)
at /home/node/node_modules/@sentry/node/cjs/integrations/onuncaughtexception.js:71:17
at Hub.withScope (/home/node/node_modules/@sentry/hub/cjs/hub.js:98:7)
at OnUncaughtException.handler (/home/node/node_modules/@sentry/node/cjs/integrations/onuncaughtexception.js:69:15)
at process.emit (node:events:525:35)
at process.emit (node:domain:489:12)
at process._fatalException (node:internal/process/execution:167:25)
Issue Analytics
- State:
- Created a year ago
- Comments:18 (7 by maintainers)
Top Results From Across the Web
Usage | Sentry Documentation
You can use captureException to manually report errors: JavaScript ... This means it should probably make an explicit process.exit() call.
Read more >Using Sentry - errors, or all messages? ; Logging versus ...
get_logger(), and whenever I call logger.error(), it will pass to Sentry? Or I can just put client.captureException() into my exception handling code.
Read more >Usage — raven-js 3.4.0 documentation - Read the Docs
The simplest way, is to try and explicitly capture and report potentially problematic code with a try...catch block and Raven.captureException . try { ......
Read more >How to log error in catch statement in sentry - Stack Overflow
For some SDKs, you can also omit the argument to captureException and Sentry will attempt to capture the current exception.
Read more >8. Errors and Exceptions — Python 3.11.1 documentation
Errors detected during execution are called exceptions and are not unconditionally fatal: you ... They include SystemExit which is raised by sys.exit() and ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m getting this same error, but for
exception
while callingcaptureException
.How is the error handling within the sentry node package so extremely poor, that errors like this bubble up with vague messaging instead of being caught within the lib, with proper custom errors (with codes) thrown? This is basic package authoring stuff folks.
There is some funky stuff going on in the
kafkajs
package: https://github.com/tulios/kafkajs/blob/master/src/producer/partitioners/legacy/randomBytes.jsI can’t pinpoint the exact problem yet but I bet it has to do with this.