From 97e27352b9c8a586acff9cc35d383b41f506f42d Mon Sep 17 00:00:00 2001 From: icex2 Date: Mon, 19 Feb 2024 21:48:03 +0100 Subject: [PATCH] feat(avs-util): Add helper to translate property errors --- src/main/avs-util/error.c | 10 ++++++++++ src/main/avs-util/error.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/main/avs-util/error.c b/src/main/avs-util/error.c index ab09c01..d31b2e1 100644 --- a/src/main/avs-util/error.c +++ b/src/main/avs-util/error.c @@ -96,4 +96,14 @@ const char *avs_util_error_str(avs_error error) } return avs_util_error_unknown; +} + +const char *avs_util_property_error_get_and_clear(struct property *prop) +{ + avs_error error; + + error = property_get_error(prop); + property_clear_error(prop); + + return avs_util_error_str(error); } \ No newline at end of file diff --git a/src/main/avs-util/error.h b/src/main/avs-util/error.h index 3598851..bdf415e 100644 --- a/src/main/avs-util/error.h +++ b/src/main/avs-util/error.h @@ -5,4 +5,6 @@ const char *avs_util_error_str(avs_error error); +const char *avs_util_property_error_get_and_clear(struct property *prop); + #endif \ No newline at end of file