Skip to content

Commit 29dff53

Browse files
committed
throw error when no more minutes left
1 parent e4b704d commit 29dff53

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/tunnel-launcher.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ function run (options, callback) {
130130
if (data.indexOf('401 Unauthorized') > -1) {
131131
activeTunnel.error = 'Invalid credentials. Please supply the correct key/secret obtained from TestingBot.com'
132132
activeTunnel.close()
133+
} else if (data.indexOf('minutes left') > -1) {
134+
activeTunnel.error = 'You do not have any minutes left. Please upgrade your account at TestingBot.com'
135+
activeTunnel.close()
133136
}
134137
})
135138

@@ -154,7 +157,9 @@ function run (options, callback) {
154157
}
155158

156159
activeTunnel.on('exit', (code, signal) => {
157-
logger('Closing TestingBot Tunnel')
160+
if (options.verbose) {
161+
logger('Closing TestingBot Tunnel')
162+
}
158163
if (!started) {
159164
callback(new Error(activeTunnel.error ? activeTunnel.error : `Could not start TestingBot Tunnel. Exit code ${code} signal: ${signal}`))
160165
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"author": "TestingBot <info@testingbot.com> (testingbot.com)",
33
"name": "testingbot-tunnel-launcher",
44
"description": "A wrapper around TestingBot's Tunnel",
5-
"version": "1.1.10",
5+
"version": "1.1.11",
66
"homepage": "https://github.com/testingbot/testingbot-tunnel-launcher",
77
"scripts": {
88
"lint": "eslint lib/",

0 commit comments

Comments
 (0)