Skip to content

Commit

Permalink
Revert "add option to print full payload on invalid message (#5979)" (#…
Browse files Browse the repository at this point in the history
…5981)

Now that the error has been resolved. This reverts commit eb3f8bf.
  • Loading branch information
john-z-yang authored May 30, 2024
1 parent da2b886 commit 755c0f7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions rust_snuba/src/processors/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use rust_arroyo::backends::kafka::types::KafkaPayload;

use crate::config::ProcessorConfig;
use crate::processors::utils::{enforce_retention, StringToIntDatetime};
use crate::runtime_config::get_str_config;
use crate::types::{
InsertBatch, InsertOrReplacement, KafkaMessageMetadata, ReplacementData, RowData,
};
Expand All @@ -41,10 +40,7 @@ pub fn process_message_with_replacement(
let four = from_slice(payload_bytes).map(|_: FourTrain| ());
let three = from_slice(payload_bytes).map(|_: ThreeTrain| ());

let format_full_invalid_payload = get_str_config("errors_format_full_invalid_payload").map_or(false, |o| o.map_or(false, |v| v.as_str() == "true"));

format!("payload start: {}\n\nerror trying to deserialize as event: {:?}\n\nerror trying to deserialize as replacement: {:?}",
if format_full_invalid_payload {String::from_utf8_lossy(payload_bytes)} else {String::from_utf8_lossy(&payload_bytes[..50])}, four, three)
format!("payload start: {}\n\nerror trying to deserialize as event: {:?}\n\nerror trying to deserialize as replacement: {:?}", String::from_utf8_lossy(&payload_bytes[..50]), four, three)
})?;

let (version, msg_type, error_event, replacement_event) = match msg {
Expand Down

0 comments on commit 755c0f7

Please sign in to comment.