Skip to content

Commit

Permalink
review 2
Browse files Browse the repository at this point in the history
  • Loading branch information
philipperolet committed Sep 1, 2023
1 parent 876225a commit ca0e3f3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
25 changes: 15 additions & 10 deletions core/bin/dust_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -728,15 +728,20 @@ async fn runs_create_stream(
});
}
Err((_, api_error)) => {
if let Some(error) = &api_error.0.error {
let _ = tx.send(json!({
"type": "error",
"content": {
"code": error.code,
"message": error.message,
},
}));
}
let error = match api_error.0.error {
Some(error) => error,
None => APIError {
code: "internal_server_error".to_string(),
message: "The app execution failed unexpectedly".to_string(),
},
};
let _ = tx.send(json!({
"type": "error",
"content": {
"code": error.code,
"message": error.message,
},
}));
}
}

Expand Down Expand Up @@ -1219,7 +1224,7 @@ fn error_response(
error: Some(APIError {
code: code.to_string(),
message: match error {
Some(err) => format!("{}\nError: {:?}", message, err),
Some(err) => format!("{} (error: {:?})", message, err),
None => message.to_string(),
},
}),
Expand Down
2 changes: 1 addition & 1 deletion core/src/data_sources/data_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ impl DataSource {
payload.insert(field_name, field_value.into());

let field_condition = qdrant::FieldCondition {
key: "document_id".to_string(),
key: "document_id_hash".to_string(),
r#match: Some(qdrant::Match {
match_value: Some(qdrant::r#match::MatchValue::Text(document_id)),
}),
Expand Down

0 comments on commit ca0e3f3

Please sign in to comment.