mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-26 14:45:50 +00:00
chore(sample-docs): unify error handling with panic(err).
This commit is contained in:
@@ -23,14 +23,12 @@ func main() {
|
||||
fmt.Println("Setting up credential issuer wallet...")
|
||||
issuer, err := wallet.New(crypto.ED25519())
|
||||
if err != nil {
|
||||
fmt.Printf("Error creating issuer wallet: %s\n", err)
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
|
||||
err = client.FundWallet(&issuer)
|
||||
if err != nil {
|
||||
fmt.Printf("Error funding issuer wallet: %s\n", err)
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("Issuer wallet funded: %s\n", issuer.ClassicAddress)
|
||||
|
||||
@@ -40,14 +38,12 @@ func main() {
|
||||
fmt.Println("Setting up Subject wallet...")
|
||||
subjectWallet, err := wallet.New(crypto.ED25519())
|
||||
if err != nil {
|
||||
fmt.Printf("Error creating subject wallet: %s\n", err)
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
|
||||
err = client.FundWallet(&subjectWallet)
|
||||
if err != nil {
|
||||
fmt.Printf("Error funding subject wallet: %s\n", err)
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("Subject wallet funded: %s\n", subjectWallet.ClassicAddress)
|
||||
|
||||
@@ -60,8 +56,7 @@ func main() {
|
||||
credentialType := types.CredentialType("6D795F63726564656E7469616C")
|
||||
|
||||
if err != nil {
|
||||
fmt.Printf("Error converting expiration to ripple time: %s\n", err)
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
|
||||
txn := &transaction.CredentialCreate{
|
||||
|
||||
Reference in New Issue
Block a user