fix: possible wrong error for upnp requests
Massimo Melina committed
Jul 5, 2025 at 20:29 UTC
eec992324ce0dc7ee079dc956cb58dfedd4d8da0
2 files changed
+2
-2
package.json
+1
-1
@@ -90,7 +90,7 @@
90
"limiter": "^2.1.0",
91
"lodash": "^4.17.21",
92
"minimist": "^1.2.6",
93
- "nat-upnp-rejetto": "^2.1.0",
93
+ "nat-upnp-rejetto": "^2.1.1",
94
"node-forge": "^1.3.1",
95
"open": "^8.4.0",
96
"picomatch": "^3.0.1",
src/api.net.ts
+1
-1
@@ -54,7 +54,7 @@ const apis: ApiHandlers = {
54
if (external) // must use the object form of 'public' to work around a bug of the library
55
await upnpClient.createMapping({ private: internal || internalPort, public: { host: '', port: external }, description: 'hfs', ttl: 0 })
56
.catch(res => {
57
- throw new ApiError(res.errorCode || HTTP_SERVER_ERROR, res.errorCode === 718 ? "Port not available" : res.errorDescription || "unknown error")
57
+ throw new ApiError(res.errorCode || HTTP_SERVER_ERROR, res.errorCode === 718 ? "Port not available" : res.errorDescription || res.message || "unknown error")
58
})
59
return {}
60
},