Skip to content

Commit

Permalink
feat: use RegionNotReady instead of RegionNotFound for a registering …
Browse files Browse the repository at this point in the history
…region
  • Loading branch information
WenyXu committed Dec 20, 2023
1 parent e6dac4a commit c3a9c3d
Show file tree
Hide file tree
Showing 5 changed files with 366 additions and 36 deletions.
7 changes: 7 additions & 0 deletions src/datanode/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ pub enum Error {
location: Location,
},

#[snafu(display("RegionId {} not ready", region_id))]
RegionNotReady {
region_id: RegionId,
location: Location,
},

#[snafu(display("Region engine {} is not registered", name))]
RegionEngineNotFound { name: String, location: Location },

Expand Down Expand Up @@ -295,6 +301,7 @@ impl ErrorExt for Error {
| GetRegionMetadata { .. } => StatusCode::Internal,

RegionNotFound { .. } => StatusCode::RegionNotFound,
RegionNotReady { .. } => StatusCode::RegionNotReady,

StartServer { source, .. } | ShutdownServer { source, .. } => source.status_code(),

Expand Down
Loading

0 comments on commit c3a9c3d

Please sign in to comment.