diff --git a/android/app/src/main/java/com/middle/app/ble/SyncForegroundService.kt b/android/app/src/main/java/com/middle/app/ble/SyncForegroundService.kt index c5ea971..efe2e47 100644 --- a/android/app/src/main/java/com/middle/app/ble/SyncForegroundService.kt +++ b/android/app/src/main/java/com/middle/app/ble/SyncForegroundService.kt @@ -284,6 +284,7 @@ class SyncForegroundService : Service() { skipTranscription = true } else { scope.launch(Dispatchers.IO) { + try { val client = TranscriptionClient(provider, apiKey) val text = client.transcribe(audioFile) if (text != null) { @@ -324,6 +325,10 @@ class SyncForegroundService : Service() { updateNotification(message) skipTranscription = true } + } catch (exception: Exception) { + Log.e(TAG, "Transcription coroutine failed for $filename: $exception") + WebhookLog.error("Transcription error ($filename): ${exception::class.simpleName}: ${exception.message}") + } } } }