- sock = -1;
- /*
- * TODO: Inform client somehow of the fatal error. At
- * this point, ret < 0 means that a zmalloc failed
- * (ENOMEM). Error detected but still accept
- * command, unless a socket error has been
- * detected.
- */
- continue;
+ } catch (const std::bad_alloc& ex) {
+ WARN_FMT("Failed to allocate memory while handling client request: {}",
+ ex.what());
+ ret = LTTNG_ERR_NOMEM;
+ } catch (const lttng::ctl::error& ex) {
+ WARN_FMT("Client request failed: {}", ex.what());
+ ret = ex.code();
+ } catch (const std::exception& ex) {
+ WARN_FMT("Client request failed: {}", ex.what());
+ ret = LTTNG_ERR_UNK;