To ensure users are properly notified when a TTS service encounters an error (such as quota exhaustion, API issues, or connection failures), TTS workers running in separate processes must propagate errors back to the main process (core.py).
When a TTS worker (e.g. steprealtimettsworker, qwenrealtimettsworker, etc.) catches an error, it MUST NOT only log the error using logger.error(). It MUST ALSO send the error message back to the main process through its responsequeue using the explicit tuple format ("error", errormsg).
This ensures that core.py's ttsresponsehandler can intercept the error and translate it into a frontend WebSocket message (type: 'status'), triggering a user-friendly Toast notification (e.g., "💥 免费TTS限额已耗尽").
اتفاقية الإبلاغ عن الأخطاء من عمال TTS متعددي المعالجة إلى الواجهة الأمامية للعملية الرئيسية. استخدم هذه المهارة عند تعديل أو إضافة أو تصحيح أخطاء عمال TTS في tts_client.py للتأكد من أن أخطاء الاتصال والحصص وحدود واجهة برمجة التطبيقات تعرض إشعارات Toast للمستخدم بشكل صحيح بدلاً من الفشل بصمت. المصدر: project-n-e-k-o/n.e.k.o.