Skip to content

Commit 1d48964

Browse files
author
icex2
committed
feat(avs-util): Add helper to translate property errors
1 parent 33fee83 commit 1d48964

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/main/avs-util/error.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,14 @@ const char *avs_util_error_str(avs_error error)
9696
}
9797

9898
return avs_util_error_unknown;
99+
}
100+
101+
const char *avs_util_property_error_get_and_clear(struct property *prop)
102+
{
103+
avs_error error;
104+
105+
error = property_get_error(prop);
106+
property_clear_error(prop);
107+
108+
return avs_util_error_str(error);
99109
}

src/main/avs-util/error.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55

66
const char *avs_util_error_str(avs_error error);
77

8-
#endif
8+
const char *avs_util_property_error_get_and_clear(struct property *prop);
9+
10+
#endif

0 commit comments

Comments
 (0)