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

@@ -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{