Fix a crasher in production (#2313)

When I deployed 5e99aad2de to s0, shortly after Sentry picked up an unhandled error. I'm not sure which of the legacy badges this is in.

The bug was introduced just now, in #2257. Oops!

A test would have caught this, but I don't think it's worth wrapping tests around this difficult-to-test code. It makes more sense I think, to refactor the remaining badges that use it, replace it with something using async/await (maybe based on [node-cache](https://www.npmjs.com/package/node-cache), and test that.
This commit is contained in:
Paul Melnikow
2018-11-15 14:25:46 -05:00
committed by GitHub
parent b68ac16092
commit 5d63effabc

View File

@@ -54,9 +54,11 @@ function regularUpdate(
}
if (res.statusCode < 200 || res.statusCode >= 300) {
throw new InvalidResponse({
prettyMessage: 'intermediate resource inaccessible',
})
cb(
new InvalidResponse({
prettyMessage: 'intermediate resource inaccessible',
})
)
}
let reqData