mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-28 23:55:49 +00:00
chore(sample-docs): unify error handling with panic(err).
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user