Skip to content

Commit

Permalink
Update UPNPHelper.ts
Browse files Browse the repository at this point in the history
handle upnp timeout errors seperately
  • Loading branch information
devbence committed Mar 30, 2024
1 parent 4bb1145 commit c40af4e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/upnp/UPNPHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ export class UPNPHelper {
Promise.all(new Array(akiPromise, sitWSPromise, natPromise, p2pPromise)).then((x) => {
console.log(`SIT: UPNP: Successfully mapped ${this.akiPort},${this.coopConfig.webSocketPort},${this.coopConfig.natHelperPort},6972`);
}).catch((rejectedReason) => {
console.log(`SIT: UPNP: Unable to Map: ${rejectedReason}`);
if (rejectedReason instanceof Error && rejectedReason.message.includes('Timeout')) {
console.log(`SIT: UPNP: UPnP request timed out. Ignore if port forwarding or direct connection is in place.`);
}
else {
console.log(`SIT: UPNP: Unable to Map: ${rejectedReason}`);
}
});
}

Expand Down

0 comments on commit c40af4e

Please sign in to comment.