CleanInitError turns the gRPC-wrapped plugin-init error from the platform destination into a human-readable message: it unwraps the gRPC status (drops the "rpc error: code = ... desc =" prefix) and strips the plugin-sdk wrapper prefixes, leaving the destination's own message (e.g. the platform's 422
(err error)
| 552 | // Scope this to the platform destination (see IsInjectedDestination) — the |
| 553 | // stripped prefixes are specific to that plugin's init path. |
| 554 | func CleanInitError(err error) string { |
| 555 | msg := status.Convert(err).Message() |
| 556 | for _, prefix := range []string{"failed to init plugin: ", "failed to initialize client: "} { |
| 557 | msg = strings.TrimPrefix(msg, prefix) |
| 558 | } |
| 559 | return msg |
| 560 | } |
no outgoing calls