From fd5cb3134f2ccce13ad9425d0fb90d338495b71d Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Thu, 23 Jan 2025 17:30:57 -0800 Subject: [PATCH] Improve errors. --- .github/workflows/moon.yml | 1 + crates/remote/src/grpc_remote_client.rs | 9 ++------- crates/remote/src/remote_error.rs | 11 ++--------- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/.github/workflows/moon.yml b/.github/workflows/moon.yml index 993ae74b08b..eead792c028 100644 --- a/.github/workflows/moon.yml +++ b/.github/workflows/moon.yml @@ -37,6 +37,7 @@ jobs: cache-base: '^(master|develop-)' - run: cargo run -- --color --log trace ci --base ${{ github.base_ref || 'master' }} env: + DEPOT_TOKEN: ${{ secrets.DEPOT_TOKEN }} MOON_NODE_VERSION: ${{ matrix.node-version }} MOONBASE_SECRET_KEY: ${{ secrets.MOONBASE_SECRET_KEY }} MOONBASE_ACCESS_KEY: ${{ secrets.MOONBASE_ACCESS_KEY }} diff --git a/crates/remote/src/grpc_remote_client.rs b/crates/remote/src/grpc_remote_client.rs index b5f7b456801..8eba208f913 100644 --- a/crates/remote/src/grpc_remote_client.rs +++ b/crates/remote/src/grpc_remote_client.rs @@ -30,13 +30,8 @@ fn map_transport_error(error: tonic::transport::Error) -> RemoteError { fn map_status_error(error: tonic::Status) -> RemoteError { dbg!(&error); - match error.source() { - Some(src) => RemoteError::GrpcCallFailedViaSource { - error: src.to_string(), - }, - None => RemoteError::GrpcCallFailed { - error: Box::new(error), - }, + RemoteError::GrpcCallFailed { + error: Box::new(error), } } diff --git a/crates/remote/src/remote_error.rs b/crates/remote/src/remote_error.rs index 51217b3fbe5..aa83dfa6d09 100644 --- a/crates/remote/src/remote_error.rs +++ b/crates/remote/src/remote_error.rs @@ -5,15 +5,8 @@ use thiserror::Error; #[derive(Error, Debug, Diagnostic)] pub enum RemoteError { #[diagnostic(code(remote::grpc::call_failed))] - #[error("Failed to make gRPC call.")] - GrpcCallFailed { - #[source] - error: Box, - }, - - #[diagnostic(code(remote::grpc::call_failed))] - #[error("Failed to make gRPC call: {error}")] - GrpcCallFailedViaSource { error: String }, + #[error("Failed to make gRPC call.\n{}: {}", .error.code(), .error.message())] + GrpcCallFailed { error: Box }, #[diagnostic(code(remote::grpc::connect_failed))] #[error("Failed to connect to gRPC host.")]