refactor: better status code

Signed-off-by: discord9 <discord9@163.com>
This commit is contained in:
discord9
2026-03-16 19:54:45 +08:00
parent e5bc572e66
commit 8541e0d096
2 changed files with 3 additions and 2 deletions

View File

@@ -75,7 +75,7 @@ async fn test_incremental_query_stale_error() {
}
_ => panic!("unexpected err: {err}"),
};
assert_eq!(StatusCode::InvalidArguments, err.status_code());
assert_eq!(StatusCode::RequestOutdated, err.status_code());
let err_msg = err.to_string();
assert!(err_msg.contains("STALE_CURSOR"));
assert!(err_msg.contains(&region_id.to_string()));

View File

@@ -1300,7 +1300,6 @@ impl ErrorExt for Error {
| InvalidScanIndex { .. }
| InvalidMeta { .. }
| InvalidRequest { .. }
| IncrementalQueryStale { .. }
| PartitionExprVersionMismatch { .. }
| FillDefault { .. }
| ConvertColumnDataType { .. }
@@ -1319,6 +1318,8 @@ impl ErrorExt for Error {
| SerializePartitionExpr { .. }
| InvalidSourceAndTargetRegion { .. } => StatusCode::InvalidArguments,
IncrementalQueryStale { .. } => StatusCode::RequestOutdated,
RegionMetadataNotFound { .. }
| Join { .. }
| WorkerStopped { .. }