jfjoch_broker: remove httplib error handler, which was overwriting error status codes

This commit is contained in:
2026-04-27 15:01:06 +02:00
parent c400ce4401
commit ec0cf9262d
2 changed files with 6 additions and 5 deletions
+4 -4
View File
@@ -138,10 +138,6 @@ std::pair<int, std::string> JFJochBrokerHttp::handleOperationException(const std
void JFJochBrokerHttp::attach(httplib::Server &server) {
register_routes(server);
server.set_error_handler([](const httplib::Request &, httplib::Response &res) {
res.status = 404;
res.set_content("The requested method does not exist", "text/plain");
});
}
void JFJochBrokerHttp::register_routes(httplib::Server &server) {
@@ -399,6 +395,8 @@ void JFJochBrokerHttp::wait_until_running_post(const std::optional<int32_t> &tim
else
status = state_machine.WaitTillNotBusy(std::chrono::seconds(timeout.value()));
logger.Info("Wait until running");
switch (status.state) {
case JFJochState::Measuring:
response.status = 200;
@@ -429,6 +427,8 @@ void JFJochBrokerHttp::wait_till_done_post(const std::optional<int32_t> &timeout
else
status = state_machine.WaitTillMeasurementDone(std::chrono::seconds(timeout.value()));
logger.Info("Wait till done");
switch (status.state) {
case JFJochState::Idle:
response.status = 200;
+2 -1
View File
@@ -6,7 +6,8 @@ This is an UNSTABLE release. The release has significant modifications and bug f
* jfjoch_broker: Cleanup DECTRIS start-up code to enable a shorter start time
* jfjoch_broker: Allow for asynchronous start to allow overlapping detector configuration with other beamline preparations
* jfjoch_broker: Goniometer axis name is converted to lowercase
*
* jfjoch_broker: Fix bug, where wrong HTTP error codes were returned
### 1.0.0-rc.137
This is an UNSTABLE release. The release has significant modifications and bug fixes, if things go wrong, it is better to revert to 1.0.0-rc.132.