cli: print error causes in all error paths
[babeltrace.git] / src / cli / babeltrace2.c
index 7dfeedbdb3091252d8c447d312e3e40abe0acb1b..0339426dc4e7c8f33f037679ead7eb2cc6520ba8 100644 (file)
@@ -2838,7 +2838,6 @@ int main(int argc, const char **argv)
                break;
        case BT_CMD_STATUS_ERROR:
                retcode = 1;
-               print_error_causes();
                break;
        case BT_CMD_STATUS_INTERRUPTED:
                retcode = 2;
@@ -2849,6 +2848,10 @@ int main(int argc, const char **argv)
        }
 
 end:
+       if (retcode == 1) {
+               print_error_causes();
+       }
+
        BT_OBJECT_PUT_REF_AND_RESET(cfg);
        fini_loaded_plugins();
        bt_interrupter_put_ref(the_interrupter);
This page took 0.025737 seconds and 4 git commands to generate.