Fix: syscall event rule: emission sites not compared in is_equal
[lttng-tools.git] / src / bin / lttng / lttng.cpp
index b84fe3407069613d0c345956876d6dce73f76008..48b02c6272687ed3d905ddc363c47d19d182e5b0 100644 (file)
@@ -234,7 +234,13 @@ static int handle_command(int argc, char **argv)
        while (cmd->name != nullptr) {
                /* Find command */
                if (strcmp(argv[0], cmd->name) == 0) {
-                       ret = cmd->func(argc, (const char **) argv);
+                       try {
+                               ret = cmd->func(argc, (const char **) argv);
+                       } catch (const std::exception& e) {
+                               ERR_FMT("{}", e.what());
+                               ret = CMD_ERROR;
+                       }
+
                        goto end;
                }
                i++;
@@ -484,7 +490,7 @@ int main(int argc, char **argv)
        try {
                return _main(argc, argv);
        } catch (const std::exception& e) {
-               ERR_FMT("Unhandled exception caught by client: %s", e.what());
+               ERR_FMT("Unhandled exception caught by client: {}", e.what());
                abort();
        }
 }
This page took 0.023355 seconds and 4 git commands to generate.