Starting work on the actual website

This commit is contained in:
Caleb Gardner
2024-07-13 03:31:37 -05:00
parent e43409923c
commit 15dcc2928a
6 changed files with 97 additions and 13 deletions
+6 -6
View File
@@ -14,11 +14,11 @@ type ArchivedCrash struct {
}
type IndividualCrash struct {
Platform string `json:"platform" bson:"platform"`
AppVersion string `json:"appVersion" bson:"appVersion"`
Error string `json:"error" bson:"error"`
Stack string `json:"stack" bson:"stack"`
Count int `json:"count" bson:"count"`
Platform string `json:"platform" bson:"platform"`
Version string `json:"version" bson:"version"`
Error string `json:"error" bson:"error"`
Stack string `json:"stack" bson:"stack"`
Count int `json:"count" bson:"count"`
}
type CrashReport struct {
@@ -44,7 +44,7 @@ func (b *Backend) reportCrash(w http.ResponseWriter, r *http.Request) {
defer r.Body.Close()
var crash IndividualCrash
err = json.NewDecoder(r.Body).Decode(&crash)
if err != nil || crash.Platform == "" || crash.AppVersion == "" || crash.Error == "" || crash.Stack == "" {
if err != nil || crash.Platform == "" || crash.Version == "" || crash.Error == "" || crash.Stack == "" {
ReturnError(w, http.StatusBadRequest, "invalidBody", "Bad request")
return
}