mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-12-02 01:25:50 +00:00
chore(sample-docs): unify error handling with panic(err).
This commit is contained in:
@@ -23,8 +23,7 @@ func main() {
|
||||
defer client.Disconnect()
|
||||
|
||||
if err := client.Connect(); err != nil {
|
||||
fmt.Println("Error connecting to devnet:", err)
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if !client.IsConnected() {
|
||||
@@ -40,12 +39,10 @@ func main() {
|
||||
// Create and fund the NFT minter wallet
|
||||
nftMinter, err := wallet.New(crypto.ED25519())
|
||||
if err != nil {
|
||||
fmt.Println("Error creating NFT minter wallet:", err)
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
if err := client.FundWallet(&nftMinter); err != nil {
|
||||
fmt.Println("Error funding NFT minter wallet:", err)
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
fmt.Println("NFT minter wallet funded!")
|
||||
|
||||
@@ -67,8 +64,7 @@ func main() {
|
||||
Wallet: &nftMinter,
|
||||
})
|
||||
if err != nil {
|
||||
fmt.Println("Error minting first NFT:", err)
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
if !responseMint.Validated {
|
||||
fmt.Println("First NFTokenMint transaction is not in a validated ledger", responseMint)
|
||||
@@ -114,8 +110,7 @@ func main() {
|
||||
Wallet: &nftMinter,
|
||||
})
|
||||
if err != nil {
|
||||
fmt.Println("Error minting second NFT:", err)
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
if !responseMint.Validated {
|
||||
fmt.Println("Second NFTokenMint transaction is not in a validated ledger", responseMint)
|
||||
@@ -161,8 +156,7 @@ func main() {
|
||||
Wallet: &nftMinter,
|
||||
})
|
||||
if err != nil {
|
||||
fmt.Println("Error canceling NFT offers:", err)
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
if !response.Validated {
|
||||
fmt.Println("NFTokenCancelOffer transaction is not in a validated ledger", response)
|
||||
|
||||
Reference in New Issue
Block a user