UPnP: error messages on failure to portforward instead of silently failing

This commit is contained in:
Dylan K. Taylor
2018-03-31 12:51:17 +01:00
parent 69c54de460
commit 37d085f793
2 changed files with 20 additions and 17 deletions

View File

@ -2096,7 +2096,11 @@ class Server{
if($this->getProperty("network.upnp-forwarding", false)){
$this->logger->info("[UPnP] Trying to port forward...");
UPnP::PortForward($this->getPort());
try{
UPnP::PortForward($this->getPort());
}catch(\Throwable $e){
$this->logger->alert("UPnP portforward failed: " . $e->getMessage());
}
}
$this->tickCounter = 0;