Skip to content

Commit

Permalink
changed some http error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
KipK committed May 27, 2023
1 parent e6ec93e commit 5bffa6a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/web_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ handleScheduleGet(MongooseHttpServerRequest *request, MongooseHttpServerResponse
response->setCode(200);
serializeJson(doc, *response);
} else {
response->setCode(200);
response->setCode(404);
response->print("{\"msg\":\"Not found\"}");
}
}
Expand Down Expand Up @@ -650,7 +650,7 @@ void handleLimitGet(MongooseHttpServerRequest *request, MongooseHttpServerRespon
limit.get().serialize(response);
} else {
response->setCode(200);
response->print("{\"msg\":\"no limit\"}");
response->print("{}");
}
}

Expand Down Expand Up @@ -776,7 +776,7 @@ void handleEmeter(MongooseHttpServerRequest *request)
props.serialize(response);
} else {
response->setCode(200);
response->print("{\"msg\":\"No manual override\"}");
response->print("{}");
}
}

Expand All @@ -796,7 +796,7 @@ void handleOverridePost(MongooseHttpServerRequest *request, MongooseHttpServerRe
response->print("{\"msg\":\"Failed to claim manual overide\"}");
}
} else {
response->setCode(500);
response->setCode(415);
response->print("{\"msg\":\"Failed to parse JSON\"}");
}
}
Expand Down Expand Up @@ -917,12 +917,12 @@ handleRestart(MongooseHttpServerRequest *request) {
}
}
else {
response->setCode(405);
response->setCode(415);
response->print("{\"msg\":\"wrong payload\"}");
request->send(response);
}
} else {
response->setCode(405);
response->setCode(415);
response->print("{\"msg\":\"Couldn't parse json\"}");
request->send(response);
}
Expand Down

0 comments on commit 5bffa6a

Please sign in to comment.