chore(sample-docs): unify error handling with panic(err).

This commit is contained in:
banasa44
2025-08-25 12:44:07 +02:00
parent 162a97887e
commit 31be92a37c
41 changed files with 402 additions and 809 deletions

View File

@@ -29,12 +29,10 @@ func main() {
// Create and fund the nft wallet
nftWallet, err := wallet.New(crypto.ED25519())
if err != nil {
fmt.Println("Error creating nft wallet:", err)
return
panic(err)
}
if err := client.FundWallet(&nftWallet); err != nil {
fmt.Println("Error funding nft wallet:", err)
return
panic(err)
}
fmt.Println("NFT wallet funded: ", nftWallet.ClassicAddress)
fmt.Println()
@@ -56,8 +54,7 @@ func main() {
Wallet: &nftWallet,
})
if err != nil {
fmt.Println("Error minting NFT:", err)
return
panic(err)
}
if !responseMint.Validated {
fmt.Println("NFTokenMint txn is not in a validated ledger", responseMint)
@@ -96,8 +93,7 @@ func main() {
Wallet: &nftWallet,
})
if err != nil {
fmt.Println("Error modifying NFT:", err)
return
panic(err)
}
if !responseModify.Validated {
fmt.Println("NFTokenModify txn is not in a validated ledger", responseModify)

View File

@@ -23,8 +23,7 @@ func main() {
defer client.Disconnect()
if err := client.Connect(); err != nil {
fmt.Println(err)
return
panic(err)
}
if !client.IsConnected() {
@@ -39,12 +38,10 @@ func main() {
fmt.Println("Funding wallet...")
nftWallet, err := wallet.New(crypto.ED25519())
if err != nil {
fmt.Println("Error creating nft wallet:", err)
return
panic(err)
}
if err := client.FundWallet(&nftWallet); err != nil {
fmt.Println("Error funding nft wallet:", err)
return
panic(err)
}
fmt.Println("NFT wallet funded!")
fmt.Println()
@@ -66,8 +63,7 @@ func main() {
Wallet: &nftWallet,
})
if err != nil {
fmt.Println("Error minting NFT:", err)
return
panic(err)
}
if !responseMint.Validated {
fmt.Println("NFTokenMint txn is not in a validated ledger", responseMint)
@@ -106,8 +102,7 @@ func main() {
Wallet: &nftWallet,
})
if err != nil {
fmt.Println("Error modifying NFT:", err)
return
panic(err)
}
if !responseModify.Validated {
fmt.Println("NFTokenModify txn is not in a validated ledger", responseModify)