diff mbox series

[4/5] trace-cruncher: Proper labeling of the libtracefs errors

Message ID 20211001133346.8217-5-y.karadz@gmail.com (mailing list archive)
State Accepted
Headers show
Series trace-cruncher: Improve error messages | expand

Commit Message

Yordan Karadzhov Oct. 1, 2021, 1:33 p.m. UTC
'TEP_ERROR' is supposed to be used with errors coming from libtraceevent,
not from libtracefs.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 src/ftracepy-utils.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/src/ftracepy-utils.c b/src/ftracepy-utils.c
index b0f5e0e..1a8a136 100644
--- a/src/ftracepy-utils.c
+++ b/src/ftracepy-utils.c
@@ -68,14 +68,14 @@  static void TfsError_fmt(struct tracefs_instance *instance,
 		vasprintf(&tc_err_log, fmt, args);
 		va_end(args);
 
-		PyErr_Format(TEP_ERROR, "%s\ntfs_error: %s",
+		PyErr_Format(TFS_ERROR, "%s\ntfs_error: %s",
 			     tc_err_log, tfs_err_log);
 
 		tfs_clear_error_log(instance);
 		free(tfs_err_log);
 		free(tc_err_log);
 	} else {
-		PyErr_FormatV(TEP_ERROR, fmt, args);
+		PyErr_FormatV(TFS_ERROR, fmt, args);
 		va_end(args);
 	}
 }
@@ -86,11 +86,11 @@  static void TfsError_setstr(struct tracefs_instance *instance,
 	char *tfs_err_log = tfs_error_log(instance, NULL);
 
 	if (tfs_err_log) {
-		PyErr_Format(TEP_ERROR, "%s\ntfs_error: %s", msg, tfs_err_log);
+		PyErr_Format(TFS_ERROR, "%s\ntfs_error: %s", msg, tfs_err_log);
 		tfs_clear_error_log(instance);
 		free(tfs_err_log);
 	} else {
-		PyErr_SetString(TEP_ERROR, msg);
+		PyErr_SetString(TFS_ERROR, msg);
 	}
 }