@@ -124,6 +124,8 @@ PHP_METHOD(IntlListFormatter, format)
124124 Z_PARAM_ARRAY_HT (ht )
125125 ZEND_PARSE_PARAMETERS_END ();
126126
127+ intl_errors_reset (LISTFORMATTER_ERROR_P (obj ));
128+
127129 uint32_t count = zend_hash_num_elements (ht );
128130 if (count == 0 ) {
129131 RETURN_EMPTY_STRING ();
@@ -154,7 +156,7 @@ PHP_METHOD(IntlListFormatter, format)
154156 }
155157 efree (items );
156158 efree (itemLengths );
157- intl_error_set ( NULL , status , "Failed to convert string to UTF-16" );
159+ intl_errors_set ( LISTFORMATTER_ERROR_P ( obj ) , status , "Failed to convert string to UTF-16" );
158160 RETURN_FALSE ;
159161 }
160162
@@ -170,7 +172,7 @@ PHP_METHOD(IntlListFormatter, format)
170172 resultLength = ulistfmt_format (LISTFORMATTER_OBJECT (obj ), items , itemLengths , count , NULL , 0 , & status );
171173
172174 if (U_FAILURE (status ) && status != U_BUFFER_OVERFLOW_ERROR ) {
173- intl_error_set ( NULL , status , "Failed to format list" );
175+ intl_errors_set ( LISTFORMATTER_ERROR_P ( obj ) , status , "Failed to format list" );
174176 RETVAL_FALSE ;
175177 goto cleanup ;
176178 }
@@ -184,7 +186,7 @@ PHP_METHOD(IntlListFormatter, format)
184186 if (result ) {
185187 efree (result );
186188 }
187- intl_error_set ( NULL , status , "Failed to format list" );
189+ intl_errors_set ( LISTFORMATTER_ERROR_P ( obj ) , status , "Failed to format list" );
188190 RETVAL_FALSE ;
189191 goto cleanup ;
190192 }
@@ -194,7 +196,7 @@ PHP_METHOD(IntlListFormatter, format)
194196 efree (result );
195197
196198 if (!ret ) {
197- intl_error_set ( NULL , status , "Failed to convert result to UTF-8" );
199+ intl_errors_set ( LISTFORMATTER_ERROR_P ( obj ) , status , "Failed to convert result to UTF-8" );
198200 RETVAL_FALSE ;
199201 } else {
200202 RETVAL_NEW_STR (ret );
0 commit comments