Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

Add error handling to Greeter tutorial #774

Merged
merged 2 commits into from
Jan 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions views/content/greeter.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,17 @@ You have now compiled your code and made it available to Geth. Now you need to
var _greeting = "Hello World!"

var greeter = greeterFactory.new(_greeting,{from:eth.accounts[0],data:greeterCompiled,gas:47000000}, function(e, contract){
if(!e) {

if(!contract.address) {
console.log("Contract transaction send: TransactionHash: " + contract.transactionHash + " waiting to be mined...");
if(e) {
console.error(e); // If something goes wrong, at least we'll know.
return;
}

} else {
console.log("Contract mined! Address: " + contract.address);
console.log(contract);
}
if(!contract.address) {
console.log("Contract transaction send: TransactionHash: " + contract.transactionHash + " waiting to be mined...");

} else {
console.log("Contract mined! Address: " + contract.address);
console.log(contract);
}
})

Expand Down