merger payload issue when errors
This commit is contained in:
@ -70,7 +70,7 @@ pub struct ErrorDetails {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub cause: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub context: Option<Vec<String>>,
|
||||
pub context: Option<Value>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub schema: Option<String>,
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ impl Merger {
|
||||
pub fn merge(&self, data: Value) -> crate::drop::Drop {
|
||||
let mut notifications_queue = Vec::new();
|
||||
|
||||
let result = self.merge_internal(data, &mut notifications_queue);
|
||||
let result = self.merge_internal(data.clone(), &mut notifications_queue);
|
||||
|
||||
let val_resolved = match result {
|
||||
Ok(val) => val,
|
||||
@ -34,7 +34,7 @@ impl Merger {
|
||||
details: crate::drop::ErrorDetails {
|
||||
path: "".to_string(),
|
||||
cause: None,
|
||||
context: None,
|
||||
context: Some(data),
|
||||
schema: None,
|
||||
},
|
||||
}]);
|
||||
|
||||
@ -36,7 +36,7 @@ impl Queryer {
|
||||
details: crate::drop::ErrorDetails {
|
||||
path: "".to_string(), // filters apply to the root query
|
||||
cause: Some(msg),
|
||||
context: filters.map(|f| vec![f.to_string()]),
|
||||
context: filters.cloned(),
|
||||
schema: Some(schema_id.to_string()),
|
||||
},
|
||||
}]);
|
||||
@ -144,7 +144,7 @@ impl Queryer {
|
||||
details: crate::drop::ErrorDetails {
|
||||
path: "".to_string(),
|
||||
cause: Some(format!("Expected array, got {}", other)),
|
||||
context: Some(vec![sql.to_string()]),
|
||||
context: Some(serde_json::json!([sql])),
|
||||
schema: Some(schema_id.to_string()),
|
||||
},
|
||||
}]),
|
||||
@ -154,7 +154,7 @@ impl Queryer {
|
||||
details: crate::drop::ErrorDetails {
|
||||
path: "".to_string(),
|
||||
cause: Some(format!("SPI error in queryer: {}", e)),
|
||||
context: Some(vec![sql.to_string()]),
|
||||
context: Some(serde_json::json!([sql])),
|
||||
schema: Some(schema_id.to_string()),
|
||||
},
|
||||
}]),
|
||||
|
||||
Reference in New Issue
Block a user