From 9d98f8c4f27b58016a8bab2f8fd4cf028f3f7702 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Sun, 30 Mar 2025 20:14:42 +0900 Subject: [PATCH] [Update] Show the error notification, prompting the user to contact us or restart VRCT, when an error occurred in stdout that error occur without status number. --- src-ui/logics/useStartPython.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src-ui/logics/useStartPython.js b/src-ui/logics/useStartPython.js index 394e8cd2..7db442b9 100644 --- a/src-ui/logics/useStartPython.js +++ b/src-ui/logics/useStartPython.js @@ -1,8 +1,13 @@ import { Command } from "@tauri-apps/api/shell"; import { store } from "@store"; import { useReceiveRoutes } from "./useReceiveRoutes"; +import { + useNotificationStatus, +} from "@logics_common"; + export const useStartPython = () => { const { receiveRoutes } = useReceiveRoutes(); + const { showNotification_Success, showNotification_Error } = useNotificationStatus(); const asyncStartPython = async () => { const command = Command.sidecar("bin/VRCT-sidecar"); @@ -16,7 +21,11 @@ export const useStartPython = () => { console.log(error, line); } }); - command.stderr.on("data", line => console.error("stderr:", line)); + command.stderr.on("data", line => { + showNotification_Error( + `An error occurred. Please restart VRCT or contact the developers. The last line:${JSON.stringify(line)}`, { hide_duration: null }); + console.error("stderr", line) + }); const backend_subprocess = await command.spawn(); store.backend_subprocess = backend_subprocess; };