Skip to content

Commit

Permalink
feat: add add_handler_after, add_handler_before, replace_handler (
Browse files Browse the repository at this point in the history
#4788)

* feat: add `add_handler_after`, `add_handler_before`, `replace_handler`

* chore: apply suggestions from CR

* test: add more tests

* feat: use `Vec` instead of `LinkedList`

* Update src/meta-srv/src/lib.rs

Co-authored-by: Yingwen <[email protected]>

---------

Co-authored-by: Yingwen <[email protected]>
  • Loading branch information
WenyXu and evenyag committed Sep 30, 2024
1 parent 6e776d5 commit c1e8084
Show file tree
Hide file tree
Showing 3 changed files with 359 additions and 64 deletions.
10 changes: 9 additions & 1 deletion src/meta-srv/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,13 @@ pub enum Error {
#[snafu(implicit)]
location: Location,
},

#[snafu(display("Handler not found: {}", name))]
HandlerNotFound {
name: String,
#[snafu(implicit)]
location: Location,
},
}

impl Error {
Expand Down Expand Up @@ -803,7 +810,8 @@ impl ErrorExt for Error {
| Error::InitExportMetricsTask { .. }
| Error::ProcedureNotFound { .. }
| Error::TooManyPartitions { .. }
| Error::TomlFormat { .. } => StatusCode::InvalidArguments,
| Error::TomlFormat { .. }
| Error::HandlerNotFound { .. } => StatusCode::InvalidArguments,
Error::LeaseKeyFromUtf8 { .. }
| Error::LeaseValueFromUtf8 { .. }
| Error::InvalidRegionKeyFromUtf8 { .. }
Expand Down
Loading

0 comments on commit c1e8084

Please sign in to comment.