I am trying to build some code but I get those two errors:
(node:12909) UnhandledPromiseRejectionWarning: NoSuchSessionError: Tried to run command without establishing a connection at Object.throwDecodedError (/home/matthew/node_modules/selenium-webdriver/lib/error.js:550:15) at parseHttpResponse (/home/matthew/node_modules/selenium-webdriver/lib/http.js:563:13) at Executor.execute (/home/matthew/node_modules/selenium-webdriver/lib/http.js:489:26) at at process._tickCallback (internal/process/next_tick.js:188:7) (node:12909) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:12909) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (node:12909) UnhandledPromiseRejectionWarning: NoSuchSessionError: Tried to run command without establishing a connection at Object.throwDecodedError (/home/matthew/node_modules/selenium-webdriver/lib/error.js:550:15) at parseHttpResponse (/home/matthew/node_modules/selenium-webdriver/lib/http.js:563:13) at Executor.execute (/home/matthew/node_modules/selenium-webdriver/lib/http.js:489:26) at at process._tickCallback (internal/process/next_tick.js:188:7) (node:12909) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
function review_balance() {
if (balance_amount > 0) {
console.log("This address has " + balance_amount + "Bitcoin");
}
else {
console.log("0 Bitcoins!");
}
}
async function searching() {
console.log("Waiting for address to be scanned on the Bitcoin blockchain...");
const result = await review_balance();
console.log(result);
}
searching();
driver.close();
This is the part of the program that is the most important and contains the problem. Can anyone give me any advice? I would be really thankful.
review_balance
does not return anything not even aPromise
. – norbitrialundefined
which is not good forawait
, 2. The return type should bePromise
. Read further here: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/… – norbitrialasync
andawait
keywords because they are not used. – norbitrial