@@ -131,6 +131,8 @@ PHP_METHOD(IntlListFormatter, format)
131131 Z_PARAM_ARRAY_HT (ht)
132132 ZEND_PARSE_PARAMETERS_END ();
133133
134+ intl_errors_reset (LISTFORMATTER_ERROR_P (obj));
135+
134136 uint32_t count = zend_hash_num_elements (ht);
135137 if (count == 0 ) {
136138 RETURN_EMPTY_STRING ();
@@ -152,7 +154,7 @@ PHP_METHOD(IntlListFormatter, format)
152154 zend_tmp_string_release (tmp_str);
153155
154156 if (U_FAILURE (conv_status)) {
155- intl_error_set ( nullptr , conv_status, " Failed to convert string to UTF-16" );
157+ intl_errors_set ( LISTFORMATTER_ERROR_P (obj) , conv_status, " Failed to convert string to UTF-16" );
156158 RETURN_FALSE;
157159 }
158160
@@ -165,14 +167,14 @@ PHP_METHOD(IntlListFormatter, format)
165167 LISTFORMATTER_OBJECT (obj)->format (items.get (), count, result, status);
166168
167169 if (U_FAILURE (status)) {
168- intl_error_set ( nullptr , status, " Failed to format list" );
170+ intl_errors_set ( LISTFORMATTER_ERROR_P (obj) , status, " Failed to format list" );
169171 RETURN_FALSE;
170172 }
171173
172174 zend_string *ret = intl_charFromString (result, &status);
173175
174176 if (!ret) {
175- intl_error_set ( nullptr , status, " Failed to convert result to UTF-8" );
177+ intl_errors_set ( LISTFORMATTER_ERROR_P (obj) , status, " Failed to convert result to UTF-8" );
176178 RETURN_FALSE;
177179 }
178180
0 commit comments