buddy-tunnel
Advanced tools
Comparing version 1.7.20-dev to 1.7.21-dev
{ | ||
"name": "buddy-tunnel", | ||
"preferGlobal": false, | ||
"version": "1.7.20-dev", | ||
"version": "1.7.21-dev", | ||
"type": "commonjs", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -9,2 +9,3 @@ const { Agent: HttpsAgent } = require('https'); | ||
ApiErrorFailedToConnect, | ||
ApiErrorTunnelsDisabled, | ||
ApiErrorWrongToken | ||
@@ -56,3 +57,3 @@ } = require('../utils'); | ||
} catch (err) { | ||
throw new ApiErrorFailedToConnect(); | ||
throw new ApiErrorFailedToConnect(host); | ||
} | ||
@@ -67,4 +68,6 @@ if (respAsJson) { | ||
throw new ApiErrorSubdomainTaken(); | ||
} else if (data.result.code === 234500) { | ||
throw new ApiErrorTunnelsDisabled(); | ||
} else { | ||
throw new ApiErrorFailedToConnect(); | ||
throw new ApiErrorFailedToConnect(host); | ||
} | ||
@@ -71,0 +74,0 @@ } |
@@ -42,2 +42,3 @@ const ERR_AGENT_NOT_REGISTERED = 'Agent not registered. Exiting...'; | ||
const ERR_SUBDOMAIN_TAKEN = 'Subdomain already reserved'; | ||
const ERR_TUNNELS_DISABLED = 'Tunnels disabled'; | ||
const ERR_TUNNEL_REMOVED = 'Tunnel has been removed'; | ||
@@ -352,2 +353,3 @@ const ERR_FAILED_TO_CONNECT_TO_AGENT = 'Failed to connect to agent'; | ||
ERR_SUBDOMAIN_TAKEN, | ||
ERR_TUNNELS_DISABLED, | ||
ERR_TUNNEL_REMOVED, | ||
@@ -354,0 +356,0 @@ AGENT_FETCH_RETRY, |
@@ -33,3 +33,4 @@ const { resolve } = require('path'); | ||
ERR_AGENT_REMOVED, | ||
ERR_SUBDOMAIN_TAKEN | ||
ERR_SUBDOMAIN_TAKEN, | ||
ERR_TUNNELS_DISABLED | ||
} = require('./texts'); | ||
@@ -149,2 +150,8 @@ | ||
class ApiErrorTunnelsDisabled extends Error { | ||
constructor() { | ||
super(ERR_TUNNELS_DISABLED); | ||
} | ||
} | ||
const TARGET_TCP_TLS_REGEX = /^(([^:]+):)?(\d+)$/i; | ||
@@ -327,2 +334,3 @@ const TARGET_HTTP_REGEX = /^((https?):\/\/)?([^:/]+:[^@:]+@)?([^:]+)(:(\d+))?$/i; | ||
ApiErrorSubdomainTaken, | ||
ApiErrorTunnelsDisabled, | ||
AGENT_SOCKET_MESSAGE_READY, | ||
@@ -329,0 +337,0 @@ AGENT_SOCKET_MESSAGE_TUNNEL, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
351945
8368