Describe the bug
The docs example of how to use handleError hook improperly uses the Sentry Node.js captureException method.
This may lead to confusion for users who copy things over and find out they don't work as-is, using the latest @sentry/node library.
I cannot find any mention of errorId in their docs and no examples show passing an errorId or an event so I'm assuming the intention is to instead pass these to extra?
Current docs:

Error when trying to pass event into captureException:

CaptureContext type for the second arg to captureException:

I believe the proper usage would likely be the following:
Sentry.captureException(error, { extra: { event, errorId } });
Also worth noting is in my experience, using @sentry/node will fail in local development and any non-node environment like CloudFlare Workers, so using @sentry/browser seems to be the approach that works cross platform.
Reproduction
See above
Logs
System Info
System:
OS: macOS 13.2.1
CPU: (8) arm64 Apple M2
Memory: 449.41 MB / 24.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.15.0 - ~/Library/Caches/fnm_multishells/62837_1680285009501/bin/node
npm: 9.5.0 - ~/Library/Caches/fnm_multishells/62837_1680285009501/bin/npm
Browsers:
Brave Browser: 106.1.44.112
Chrome: 111.0.5563.146
Firefox: 103.0
Safari: 16.3
Severity
annoyance
Additional Information
No response
Describe the bug
The docs example of how to use
handleErrorhook improperly uses the Sentry Node.jscaptureExceptionmethod.This may lead to confusion for users who copy things over and find out they don't work as-is, using the latest
@sentry/nodelibrary.I cannot find any mention of
errorIdin their docs and no examples show passing an errorId or aneventso I'm assuming the intention is to instead pass these toextra?Current docs:

Error when trying to pass

eventintocaptureException:CaptureContexttype for the second arg tocaptureException:I believe the proper usage would likely be the following:
Also worth noting is in my experience, using
@sentry/nodewill fail in local development and any non-node environment like CloudFlare Workers, so using@sentry/browserseems to be the approach that works cross platform.Reproduction
See above
Logs
System Info
System: OS: macOS 13.2.1 CPU: (8) arm64 Apple M2 Memory: 449.41 MB / 24.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.15.0 - ~/Library/Caches/fnm_multishells/62837_1680285009501/bin/node npm: 9.5.0 - ~/Library/Caches/fnm_multishells/62837_1680285009501/bin/npm Browsers: Brave Browser: 106.1.44.112 Chrome: 111.0.5563.146 Firefox: 103.0 Safari: 16.3Severity
annoyance
Additional Information
No response