mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-25 17:30:41 +00:00
refactor: better status code
Signed-off-by: discord9 <discord9@163.com>
This commit is contained in:
@@ -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(®ion_id.to_string()));
|
||||
|
||||
@@ -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 { .. }
|
||||
|
||||
Reference in New Issue
Block a user