fix(3p/nix): Prepend unix:// to daemon socket

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
This commit is contained in:
Griffin Smith 2020-08-01 15:44:48 -04:00 committed by glittershark
parent 1094e356df
commit 2646e57aae
3 changed files with 28 additions and 23 deletions

View file

@ -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()));
}
}