mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-18 15:44:36 +00:00
log database insertion errors
This commit is contained in:
1 parent
3a5b45f5ce
commit
5bb81303c2
2 files changed
+7
-4
No files matched your search
@@ -28,8 +28,9 @@ pub struct SpeakRequest {
|
||||
|
||||
pub async fn post_speak(request: HttpRequest,
|
||||
query: Json<SpeakRequest>,
|
||||
app_state: Data<Arc<AppState>>
|
||||
) -> std::io::Result<HttpResponse> {
|
||||
app_state: Data<Arc<AppState>>)
|
||||
-> std::io::Result<HttpResponse>
|
||||
{
|
||||
let app_state = app_state.into_inner();
|
||||
|
||||
let speaker_slug = query.speaker.to_string();
|
||||
@@ -65,7 +66,8 @@ pub async fn post_speak(request: HttpRequest,
|
||||
};
|
||||
|
||||
match sentence_record.insert(&app_state.database_connector) {
|
||||
Err(_) => error!("Could not insert sentence record for: {:?}", sentence_record),
|
||||
Err(e) => error!("Could not insert sentence record for: {:?}, because: {:?}",
|
||||
sentence_record, e),
|
||||
Ok(_) => {},
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,8 @@ pub async fn post_speak_with_spectrogram(request: HttpRequest,
|
||||
};
|
||||
|
||||
match sentence_record.insert(&app_state.database_connector) {
|
||||
Err(_) => error!("Could not insert sentence record for: {:?}", sentence_record),
|
||||
Err(e) => error!("Could not insert sentence record for: {:?}, because: {:?}",
|
||||
sentence_record, e),
|
||||
Ok(_) => {},
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user