-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add error for tx prover proxy (#1038)
- Loading branch information
1 parent
487e8b9
commit 2072088
Showing
8 changed files
with
67 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use axum::http::uri::InvalidUri; | ||
use thiserror::Error; | ||
|
||
// TX PROVER SERVICE ERROR | ||
// ================================================================================================ | ||
|
||
#[derive(Debug, Error)] | ||
pub enum TxProverServiceError { | ||
#[error("invalid uri {1}")] | ||
InvalidURI(#[source] InvalidUri, String), | ||
#[error("failed to connect to worker {1}")] | ||
ConnectionFailed(#[source] tonic::transport::Error, String), | ||
#[error("failed to create backend for worker")] | ||
BackendCreationFailed(#[source] Box<pingora::Error>), | ||
#[error("failed to setup pingora: {0}")] | ||
PingoraConfigFailed(String), | ||
} | ||
|
||
impl From<TxProverServiceError> for String { | ||
fn from(err: TxProverServiceError) -> Self { | ||
err.to_string() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
pub mod api; | ||
pub mod commands; | ||
pub mod error; | ||
mod proxy; | ||
mod utils; | ||
use commands::Cli; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters