Skip to content

Commit 856ef79

Browse files
committed
chore(cli): remove scary "you shouldn't see this" message
We thought people shouldn't see this message, but they occasionaly do, which leads to alarmed bug reports. It's *probably* okay to remove the `on('timeout')` event handler if we have to have this one anyway, but I'm not a 100% confident so I'd rather just make the message less objectionable and have 2 timers, than have 1 and not be sure what's going on.
1 parent d644c00 commit 856ef79

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

packages/aws-cdk/lib/notices.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,11 @@ export class WebsiteNoticeDataSource implements NoticeDataSource {
145145
req.destroy(new Error('Request timed out'));
146146
});
147147

148-
// It's not like I don't *trust* the 'timeout' event... but I don't trust it.
149-
// Add a backup timer that will destroy the request after all.
150-
// (This is at least necessary to make the tests pass, but that's probably because of 'nock'.
151-
// It's not clear whether users will hit this).
148+
// This timer is necessary to make the test pass (looks like 'nock' doesn't support the
149+
// timeout event), but we're also seeing users hit this in practice. Not exactly sure
150+
// what's causing this to fire before the on('timeout') event, but let's have both in place.
152151
setTimeout(() => {
153-
req.destroy(new Error('Request timed out. You should never see this message; if you do, please let us know at https://github.com/aws/aws-cdk/issues'));
152+
req.destroy(new Error('Request timed out.'));
154153
}, timeout + 200);
155154
} catch (e) {
156155
reject(new Error(`HTTPS 'get' call threw an error: ${e.message}`));

0 commit comments

Comments
 (0)