op-ufm: use fmt.Errorf() for panic() (#8754)

This commit is contained in:
Taeguk Kwon 2024-01-02 07:10:30 +09:00 committed by GitHub
parent c1a4964c13
commit aa3fef1ef0

@ -26,13 +26,13 @@ func main() {
ctx := context.Background() ctx := context.Background()
client, err := kms.NewKeyManagementClient(ctx) client, err := kms.NewKeyManagementClient(ctx)
if err != nil { if err != nil {
panic(fmt.Sprintf("failed to create kms client: %w", err)) panic(fmt.Errorf("failed to create kms client: %w", err))
} }
defer client.Close() defer client.Close()
addr, err := resolveAddr(ctx, client, keyName) addr, err := resolveAddr(ctx, client, keyName)
if err != nil { if err != nil {
panic(fmt.Sprintf("failed to retrieve the key: %w", err)) panic(fmt.Errorf("failed to retrieve the key: %w", err))
} }
fmt.Printf("ethereum addr: %s", addr) fmt.Printf("ethereum addr: %s", addr)
println() println()