aboutsummaryrefslogtreecommitdiffstats
path: root/vlib-api
diff options
context:
space:
mode:
authorroot <calvin.ference@gmail.com>2016-07-27 08:01:31 -0700
committerDave Barach <openvpp@barachs.net>2016-07-27 22:12:23 +0000
commitdd9f1331766be8874c029a8a265dc7ce73b87a08 (patch)
treea56e20a6a5d71c3b6e5ab087f99337fa1bb4e65b /vlib-api
parentb2a6e25067a41def7d5795df6d07231b55051ab2 (diff)
VPP-210: Clearer error codes in vlib-api for API trace save
Change-Id: Ic02eaaaa8cf7a0f1c75eca8e3b87956d5e9045e7 Signed-off-by: root <calvin.ference@gmail.com>
Diffstat (limited to 'vlib-api')
-rw-r--r--vlib-api/vlibapi/api_shared.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/vlib-api/vlibapi/api_shared.c b/vlib-api/vlibapi/api_shared.c
index 09502c69..fd23c458 100644
--- a/vlib-api/vlibapi/api_shared.c
+++ b/vlib-api/vlibapi/api_shared.c
@@ -1083,8 +1083,20 @@ api_trace_command_fn (vlib_main_t * vm,
}
rv = vl_msg_api_trace_save (am, which, fp);
fclose (fp);
- if (rv < 0)
- vlib_cli_output (vm, "ERROR: %d", rv);
+ if (rv == -1)
+ vlib_cli_output (vm, "API Trace data not present\n");
+ else if (rv == -2)
+ vlib_cli_output (vm, "File for writing is closed\n");
+ else if (rv == -10)
+ vlib_cli_output (vm, "Error while writing header to file\n");
+ else if (rv == -11)
+ vlib_cli_output (vm, "Error while writing trace to file\n");
+ else if (rv == -12)
+ vlib_cli_output (vm, "Error while writing end of buffer trace to file\n");
+ else if (rv == -13)
+ vlib_cli_output (vm, "Error while writing start of buffer trace to file\n");
+ else if (rv < 0)
+ vlib_cli_output (vm, "Unkown error while saving: %d", rv);
else
vlib_cli_output (vm, "API trace saved to %s\n", chroot_filename);
vec_free (chroot_filename);