Skip to content

Commit f4845f7

Browse files
res_calendar_icalendar: Print iCalendar error on parsing failure.
If libical fails to parse a calendar, print the error message it provdes. Resolves: #492
1 parent 53fac14 commit f4845f7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

res/res_calendar_icalendar.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ static icalcomponent *fetch_icalendar(struct icalendar_pvt *pvt)
155155

156156
if (!ast_strlen_zero(ast_str_buffer(response))) {
157157
comp = icalparser_parse_string(ast_str_buffer(response));
158+
if (!comp) {
159+
ast_debug(3, "iCalendar response data: %s\n", ast_str_buffer(response));
160+
ast_log(LOG_WARNING, "Failed to parse iCalendar data: %s\n", icalerror_perror());
161+
}
158162
}
159163
ast_free(response);
160164

0 commit comments

Comments
 (0)