From 8d349dbe59d24732292650219da088db590cf6b8 Mon Sep 17 00:00:00 2001 From: Raju Date: Tue, 24 Mar 2026 13:11:23 +0530 Subject: [PATCH] fix[notask]: remove filesystem paths from C++ error messages in TTS FileUtils The loadFileBytes() helper included the full filesystem path in thrown runtime_error messages. When these propagate to JS error responses they leak internal server directory layout. Use generic error messages instead. Made-with: Cursor --- .../addon/src/model-interface/FileUtils.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/qvac-lib-infer-onnx-tts/addon/src/model-interface/FileUtils.hpp b/packages/qvac-lib-infer-onnx-tts/addon/src/model-interface/FileUtils.hpp index f66fa18360..7865964a00 100644 --- a/packages/qvac-lib-infer-onnx-tts/addon/src/model-interface/FileUtils.hpp +++ b/packages/qvac-lib-infer-onnx-tts/addon/src/model-interface/FileUtils.hpp @@ -9,12 +9,12 @@ namespace qvac::ttslib { inline std::string loadFileBytes(const std::string &path) { std::ifstream f(path, std::ios::binary | std::ios::ate); if (!f) - throw std::runtime_error("Cannot open file: " + path); + throw std::runtime_error("Cannot open required model file"); const size_t size = static_cast(f.tellg()); f.seekg(0); std::string data(size, '\0'); if (!f.read(data.data(), size)) - throw std::runtime_error("Failed to read file: " + path); + throw std::runtime_error("Failed to read required model file"); return data; }