pipe2browser: Add TryInit, which is like init, but it returns an error istead of
panicking..
Also, commandline utilities will use the error version to avoid
panics which are bad UX....
MultiPart: 3/4
Change-Id: I37e6355f0a3416905b32ece35963f4dbe5ba90e0
diff --git a/go/src/v.io/x/p2b/main.go b/go/src/v.io/x/p2b/main.go
index a2c83b7..20e4c73 100644
--- a/go/src/v.io/x/p2b/main.go
+++ b/go/src/v.io/x/p2b/main.go
@@ -72,7 +72,11 @@
return
}
- ctx, shutdown := v23.Init()
+ ctx, shutdown, err := v23.TryInit()
+ if err != nil {
+ vlog.Errorf("Faile to initialize the vanadium runtime: %v", err)
+ return
+ }
defer shutdown()
name := flag.Arg(0)