Skip to content

Commit

Permalink
fix: correct the error message for snappy compress (#2956)
Browse files Browse the repository at this point in the history
Signed-off-by: Zhenchi <[email protected]>
  • Loading branch information
zhongzc authored Dec 19, 2023
1 parent 29fc2ea commit ccbd497
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/servers/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ pub enum Error {
error: snap::Error,
},

#[snafu(display("Failed to compress prometheus remote request"))]
CompressPromRemoteRequest {
location: Location,
#[snafu(source)]
error: snap::Error,
},

#[snafu(display("Invalid prometheus remote request, msg: {}", msg))]
InvalidPromRemoteRequest { msg: String, location: Location },

Expand Down Expand Up @@ -444,6 +451,7 @@ impl ErrorExt for Error {
| InvalidOpentsdbJsonRequest { .. }
| DecodePromRemoteRequest { .. }
| DecodeOtlpRequest { .. }
| CompressPromRemoteRequest { .. }
| DecompressPromRemoteRequest { .. }
| InvalidPromRemoteRequest { .. }
| InvalidFlightTicket { .. }
Expand Down
2 changes: 1 addition & 1 deletion src/servers/src/prom_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ pub fn snappy_compress(buf: &[u8]) -> Result<Vec<u8>> {
let mut encoder = Encoder::new();
encoder
.compress_vec(buf)
.context(error::DecompressPromRemoteRequestSnafu)
.context(error::CompressPromRemoteRequestSnafu)
}

/// Mock timeseries for test, it is both used in servers and frontend crate
Expand Down

0 comments on commit ccbd497

Please sign in to comment.