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

Missing try/catch in codeclimate #1607

Closed
paulmelnikow opened this issue Mar 27, 2018 · 4 comments · Fixed by #1613
Closed

Missing try/catch in codeclimate #1607

paulmelnikow opened this issue Mar 27, 2018 · 4 comments · Fixed by #1613
Assignees
Labels
bug Bugs in badges and the frontend sentry Bugs found using Sentry service-badge New or updated service badge

Comments

@paulmelnikow
Copy link
Member

https://sentry.io/shields/imgshieldsio/issues/504528524/

Error: Vendor hook error:,TypeError: Cannot read property 'attributes' of undefined
    at /home/m/shields/server.js:2733:57
    at Request.request [as _callback] (/home/m/shields/lib/request-handler.js:166:9)
    at Request.self.callback (/home/m/shields/node_modules/request/request.js:186:22)
    at Request.emit (events.js:160:13)
    at Request.<anonymous> (/home/m/shields/node_modules/request/request.js:1163:10)
    at Request.emit (events.js:160:13)
    at IncomingMessage.<anonymous> (/home/m/shields/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:255:19)
    at IncomingMessage.emit (events.js:165:20)
    at endReadableNT (_stream_readable.js:1101:12)
    at process._tickCallback (internal/process/next_tick.js:152:19)
  File "/home/m/shields/server.js", line 2733, in null.<anonymous>
    const percentage = parseFloat(parsedData.data.attributes.ratings[0].measure.value);
  File "/home/m/shields/lib/request-handler.js", line 166, in Request.request [as _callback]
    callback(err, res, body);
  File "/home/m/shields/lib/log.js", line 36, in Function.error
    Raven.captureException(msg, function (sendErr) {
  File "/home/m/shields/lib/request-handler.js", line 32, in Domain.vendorDomain.on.err
    log.error('Vendor hook error:', err.stack);
...
(13 additional frame(s) were not displayed)

Error: Vendor hook error:,TypeError: Cannot read property 'attributes' of undefined
    at /home/m/shields/server.js:2733:57
    at Request.request [as _callback] (/home/m/shields/lib/request-handler.js:166:9)
    at Request.self.callback (/home/m/shields/node_modules/request/request.js:186:22)
    at Request.emit (events.js:160:13)
    at Request.<anonymous> (/home/m/shields/node_modules/request/request.js:1163:10)
    at Request.emit (events.js:160:13)
    at IncomingMessage.<anonymous> (/home/m/shields/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:255:19)
    at IncomingMessage.emit (events.js:165:20)
    at endReadableNT (_stream_readable.js:1101:12)
    at process._tickCallback (internal/process/next_tick.js:152:19)
@paulmelnikow paulmelnikow changed the title Error: Vendor hook error:,TypeError: Cannot read property 'attributes' of undefined Missing try/catch in codeclimate Mar 27, 2018
@paulmelnikow paulmelnikow added bug Bugs in badges and the frontend service-badge New or updated service badge sentry Bugs found using Sentry labels Mar 27, 2018
@paulmelnikow
Copy link
Member Author

paulmelnikow commented Mar 27, 2018

Another one for the same service:

Error: Vendor hook error:,TypeError: Cannot read property 'meta' of undefined
    at /home/m/shields/server.js:2729:41
    at Request.request [as _callback] (/home/m/shields/lib/request-handler.js:166:9)
    at Request.self.callback (/home/m/shields/node_modules/request/request.js:186:22)
    at Request.emit (events.js:160:13)
    at Request.<anonymous> (/home/m/shields/node_modules/request/request.js:1163:10)
    at Request.emit (events.js:160:13)
    at IncomingMessage.<anonymous> (/home/m/shields/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:255:19)
    at IncomingMessage.emit (events.js:165:20)
    at endReadableNT (_stream_readable.js:1101:12)
    at process._tickCallback (internal/process/next_tick.js:152:19)

https://sentry.io/shields/shields/issues/502893299/

@paulmelnikow
Copy link
Member Author

Error: Vendor hook error:,TypeError: Cannot read property 'attributes' of undefined
    at /home/m/shields/server.js:2738:63
    at Request.request [as _callback] (/home/m/shields/lib/request-handler.js:166:9)
    at Request.self.callback (/home/m/shields/node_modules/request/request.js:186:22)
    at Request.emit (events.js:160:13)
    at Request.<anonymous> (/home/m/shields/node_modules/request/request.js:1163:10)
    at Request.emit (events.js:160:13)
    at IncomingMessage.<anonymous> (/home/m/shields/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:255:19)
    at IncomingMessage.emit (events.js:165:20)
    at endReadableNT (_stream_readable.js:1101:12)
    at process._tickCallback (internal/process/next_tick.js:152:19)

@paulmelnikow
Copy link
Member Author

There are several more of these, including this one:

Error: Vendor hook error:,SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at /home/m/shields/server.js:2719:33
    at Request.request [as _callback] (/home/m/shields/lib/request-handler.js:166:9)
    at Request.self.callback (/home/m/shields/node_modules/request/request.js:186:22)
    at Request.emit (events.js:160:13)
    at Request.<anonymous> (/home/m/shields/node_modules/request/request.js:1163:10)
    at Request.emit (events.js:160:13)
    at IncomingMessage.<anonymous> (/home/m/shields/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:255:19)
    at IncomingMessage.emit (events.js:165:20)
    at endReadableNT (_stream_readable.js:1101:12)
    at process._tickCallback (internal/process/next_tick.js:152:19)

@PyvesB PyvesB self-assigned this Mar 27, 2018
@PyvesB
Copy link
Member

PyvesB commented Mar 27, 2018

I'll pick this one up. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs in badges and the frontend sentry Bugs found using Sentry service-badge New or updated service badge
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants