Skip to content

Commit

Permalink
chore(dts-plugin): log error if the code is not ETIMEDOUT (#3203)
Browse files Browse the repository at this point in the history
  • Loading branch information
2heal1 authored Nov 11, 2024
1 parent 85990e2 commit cd59ae5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/dts-plugin/src/server/DevServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,15 @@ export class ModuleFederationDevServer {
delete this._subscriberWebsocketMap[identifier];
});

this._subscriberWebsocketMap[identifier].on('error', (event) => {
if ('code' in event && event.code === 'ETIMEDOUT') {
this._subscriberWebsocketMap[identifier].on('error', (err) => {
if ('code' in err && err.code === 'ETIMEDOUT') {
fileLog(
`Can not connect ${JSON.stringify(remote)}, please make sure this remote is started locally.`,
MF_SERVER_IDENTIFIER,
'warn',
);
} else {
console.error(err);
}
this._subscriberWebsocketMap[identifier]?.close();
delete this._subscriberWebsocketMap[identifier];
Expand Down

0 comments on commit cd59ae5

Please sign in to comment.