Handle missing Java service executable

This commit is contained in:
王鹏
2026-10-10 16:35:29 +08:00
parent dd4763a4a7
commit e1c58d8117
4 changed files with 63 additions and 0 deletions

View File

@@ -90,6 +90,15 @@ def main() -> int:
return 1
process.terminate()
return process.wait()
except OSError as exc:
message = f"无法启动服务命令 {command[0]}: {exc}\n"
_write_console(console_output, message)
try:
with log_path.open("a", encoding="utf-8") as log_file:
log_file.write(message)
except OSError:
pass
return 1
finally:
if process is not None and process.stdout is not None:
process.stdout.close()