diff --git a/cmd/root.go b/cmd/root.go index 976059b..4493061 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -157,11 +157,12 @@ var RootCmd = &cobra.Command{ // save state file packState, err := packstate.FromArchive(zipPath) if err != nil { - log.Fatalln(err) - } - err = packState.Save(serverDir) - if err != nil { - log.Fatalln(err) + log.Printf("Unable to generate %s: %s\n", packstate.FileName, err) + } else { + err = packState.Save(serverDir) + if err != nil { + log.Fatalln(err) + } } files.RmEmptyDirs(serverDir) diff --git a/update/packstate/packstate.go b/update/packstate/packstate.go index e14983b..aff437e 100644 --- a/update/packstate/packstate.go +++ b/update/packstate/packstate.go @@ -67,6 +67,7 @@ func FromArchive(path string) (*Schema, error) { version, err := modrinth.Client.VersionFromMrpackFile(path) if err != nil { + // TODO: check for 404 status for custom error return nil, err } project, err := modrinth.Client.GetProject(version.ProjectId) diff --git a/web/features.go b/web/features.go index f78060b..377f3b5 100644 --- a/web/features.go +++ b/web/features.go @@ -37,6 +37,7 @@ func (c *Client) GetModel(url string, respModel interface{}, errModel error, dec }(res.Body) if res.StatusCode < http.StatusOK || res.StatusCode >= http.StatusBadRequest { + // TODO: error struct with more details if errModel == nil || json.NewDecoder(res.Body).Decode(&errModel) != nil { return errors.New("http status " + strconv.Itoa(res.StatusCode)) }