summaryrefslogtreecommitdiffhomepage
path: root/midiplay.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'midiplay.cpp')
-rw-r--r--midiplay.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/midiplay.cpp b/midiplay.cpp
index 36b732e..534508f 100644
--- a/midiplay.cpp
+++ b/midiplay.cpp
@@ -103,10 +103,10 @@ int main(int argc, char* argv[]) {
while (FCGX_Accept_r(&request) == 0) {
std::string method = FCGX_GetParam("REQUEST_METHOD", request.envp);
+ FCGX_PutS("Content-Type: text/xml\r\n\r\n", request.out);
+
try {
if (method == "POST") {
- FCGX_PutS("Content-Type: text/xml\r\n\r\n", request.out);
-
PostData data{request};
std::string command {getCommand(request)};
if (command == "start") {
@@ -128,8 +128,7 @@ int main(int argc, char* argv[]) {
throw std::runtime_error(fmt::format("Bad request method: POST expected, got {}", method).c_str());
}
} catch (const std::exception& ex) {
- FCGX_PutS("Content-Type: text/xml\r\n\r\n", request.out);
- FCGX_PutS(("<data><status>error</status><message>"s + ex.what() + "</message></data>").c_str(), request.out);
+ FCGX_PutS(("<data><status>error</status><message>Error: "s + ex.what() + "</message></data>").c_str(), request.out);
}
}
} catch (const std::exception& ex) {