core/internal/api: use gRPC statuses as much as possible
Returning plain go errors via gRPC will always result in a gRPC 'INTERNAL' error code, which is suboptimal. We go ahead and semanticize some of the possible error paths, and at the same time:
- swallow some internal errors into logs and serve sanitized errors
- move some of the internal service implementations to also use gRPC statuses
- change a panic() call into a status.Unimplemented return type
There's still plenty work to be done on this front, but this is a good first change.
Test Plan: if this is not covered by tests we're screwed anyways
X-Origin-Diff: phab/D366
GitOrigin-RevId: 71880a9e23c65631d6c4df6338855864c34bb11f
diff --git a/core/internal/node/BUILD.bazel b/core/internal/node/BUILD.bazel
index c83d095..529c6ee 100644
--- a/core/internal/node/BUILD.bazel
+++ b/core/internal/node/BUILD.bazel
@@ -16,6 +16,8 @@
"//core/internal/kubernetes:go_default_library",
"//core/internal/storage:go_default_library",
"@com_github_google_uuid//:go_default_library",
+ "@org_golang_google_grpc//codes:go_default_library",
+ "@org_golang_google_grpc//status:go_default_library",
"@org_uber_go_zap//:go_default_library",
],
)