Handle more server-side errors from the client

This commit is contained in:
2025-12-10 00:08:42 -05:00
parent e355c810da
commit f16078fe01
5 changed files with 49 additions and 16 deletions
+9 -2
View File
@@ -2,9 +2,9 @@ package main
import (
"bufio"
"encoding/json"
"fmt"
"os"
"strconv"
"strings"
"github.com/rwinkhart/go-boilerplate/back"
@@ -110,8 +110,15 @@ func main() {
}
}
}
// print EntryRoot, AgeDir and bool indicating OS type to stdout for client to store in config
fmt.Print(global.EntryRoot + global.FSSpace + global.AgeDir + global.FSSpace + strconv.FormatBool(global.IsWindows))
registerResp := synccommon.RegisterResp{EntryRoot: global.EntryRoot, AgeDir: global.AgeDir, IsWindows: global.IsWindows}
registerRespBytes, err := json.Marshal(registerResp)
if err != nil {
fmt.Printf("{\"errMsg\":\"%s\"}", err.Error())
return
}
fmt.Print(string(registerRespBytes))
case "init":
// create the necessary directories for libmuttonserver to function
_, err := global.DirInit(false)