Add error handling on the calls to the server to debug issue #132 (#137)

This commit is contained in:
Thomas Meire
2025-06-21 14:24:39 +02:00
committed by GitHub
parent 194415e785
commit 119d2d966c
2 changed files with 9 additions and 1 deletions

View File

@@ -26,7 +26,11 @@ func main() {
appInfoStr := os.Getenv("OPENCODE_APP_INFO")
var appInfo client.AppInfo
json.Unmarshal([]byte(appInfoStr), &appInfo)
err := json.Unmarshal([]byte(appInfoStr), &appInfo)
if err != nil {
slog.Error("Failed to unmarshal app info", "error", err)
os.Exit(1)
}
logfile := filepath.Join(appInfo.Path.Data, "log", "tui.log")
if _, err := os.Stat(filepath.Dir(logfile)); os.IsNotExist(err) {