Skip to content

Commit

Permalink
Wrap OpenSearch errors inside AppError
Browse files Browse the repository at this point in the history
  • Loading branch information
sestrella committed Apr 22, 2024
1 parent 6ce4078 commit fdd0324
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend-rs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ struct AppState {
pool: PgPool,
}

enum AppError {}
enum AppError {
OpenSearchError(opensearch::Error),
}

impl IntoResponse for AppError {
fn into_response(self) -> axum::response::Response {
Expand All @@ -25,7 +27,7 @@ impl IntoResponse for AppError {

impl From<opensearch::Error> for AppError {
fn from(value: opensearch::Error) -> Self {
todo!()
AppError::OpenSearchError(value)
}
}

Expand Down

0 comments on commit fdd0324

Please sign in to comment.