Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: status is not defined #250

Closed
3 tasks done
KishanBagaria opened this issue Jul 22, 2020 · 2 comments · Fixed by #251
Closed
3 tasks done

ReferenceError: status is not defined #250

KishanBagaria opened this issue Jul 22, 2020 · 2 comments · Fixed by #251

Comments

@KishanBagaria
Copy link

KishanBagaria commented Jul 22, 2020

Versions + Platform

Description

I don't have a demo. My hunch is this happens on an unhandled promise rejection and when the Sentry server returns a non-200 response:

ReferenceError: status is not defined
    at ClientRequest.<anonymous> (/Applications/MyApp.app/Contents/Resources/app/node_modules/@sentry/electron/dist/main/transports/net.js:46:25)
    at ClientRequest.emit (events.js:223:5)
    at ClientRequest.EventEmitter.emit (domain.js:475:20)
    at SimpleURLLoaderWrapper.<anonymous> (electron/js2c/browser_init.js:93:6152)
    at SimpleURLLoaderWrapper.emit (events.js:223:5)
    at SimpleURLLoaderWrapper.EventEmitter.emit (domain.js:475:20)
    at SimpleURLLoaderWrapper.topLevelDomainCallback (domain.js:130:23)

The relevant code in node_modules/@sentry/electron/dist/main/transports/net.js:

const req = electron_1.net.request(options);
req.on('error', reject);
req.on('response', (res) => {
    if (res.statusCode && res.statusCode >= 200 && res.statusCode < 300) {
        resolve({
            status: types_1.Status.fromHttpCode(res.statusCode),
        });
    }
    else {
        if (status === types_1.Status.RateLimit) { // this line
@HazAT
Copy link
Member

HazAT commented Jul 24, 2020

Will take a look.

@HazAT
Copy link
Member

HazAT commented Jul 24, 2020

Fixed in 1.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants