about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/rpc-store.cc
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2020-08-01T19·44-0400
committerglittershark <grfn@gws.fyi>2020-08-02T02·03+0000
commit2646e57aae5aedc3d07d8596aa6a61048b312e54 (patch)
tree17be4bec752472e42b20fa52b5840d99cc44aae7 /third_party/nix/src/libstore/rpc-store.cc
parent1094e356df316e28d8b7ee8ef9844d0ec7853872 (diff)
fix(3p/nix): Prepend unix:// to daemon socket r/1538
Prepend the unix:// URI scheme to the daemon socket so that grpc knows
we want to connect to a unix socket rather than another type of URI. As
part of debugging this I made the failure message for the RPCStore
include the URI, which I'm leaving in since it'll be nice to have.

Change-Id: I6e70596895117b9a0d53fe2a61d8542ceb64c940
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1543
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Tested-by: BuildkiteCI
Diffstat (limited to 'third_party/nix/src/libstore/rpc-store.cc')
-rw-r--r--third_party/nix/src/libstore/rpc-store.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/third_party/nix/src/libstore/rpc-store.cc b/third_party/nix/src/libstore/rpc-store.cc
index d1687473c1..080a1e0a5d 100644
--- a/third_party/nix/src/libstore/rpc-store.cc
+++ b/third_party/nix/src/libstore/rpc-store.cc
@@ -56,9 +56,10 @@ T FillFrom(const U& src) {
 // TODO(grfn): Obviously this should go away and be replaced by StatusOr... but
 // that would require refactoring the entire store api, which we don't feel like
 // doing right now. We should at some point though
-void SuccessOrThrow(const grpc::Status& status) {
+void const RpcStore::SuccessOrThrow(const grpc::Status& status) const {
   if (!status.ok()) {
-    throw Error(absl::StrFormat("Rpc call failed (%d): %s ",
+    throw Error(absl::StrFormat("Rpc call to %s failed (%d): %s ",
+                                uri_.value_or("unknown URI"),
                                 status.error_code(), status.error_message()));
   }
 }