Skip to content

Commit 6132ee3

Browse files
committed
Use ValueError instead of TypeError
1 parent 0142705 commit 6132ee3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/zip/php_zip.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,12 @@ static bool php_zip_parse_options(HashTable *options, zip_options *opts)
403403
}
404404

405405
if (Z_STRLEN_P(option) == 0) {
406-
zend_type_error("Option \"remove_path\" cannot be empty");
406+
zend_value_error("Option \"remove_path\" cannot be empty");
407407
return false;
408408
}
409409

410410
if (Z_STRLEN_P(option) >= MAXPATHLEN) {
411-
zend_type_error("Option \"remove_path\" must be less than %d bytes", MAXPATHLEN - 1);
411+
zend_value_error("Option \"remove_path\" must be less than %d bytes", MAXPATHLEN - 1);
412412
return false;
413413
}
414414
opts->remove_path_len = Z_STRLEN_P(option);
@@ -423,12 +423,12 @@ static bool php_zip_parse_options(HashTable *options, zip_options *opts)
423423
}
424424

425425
if (Z_STRLEN_P(option) == 0) {
426-
zend_type_error("Option \"add_path\" cannot be empty");
426+
zend_value_error("Option \"add_path\" cannot be empty");
427427
return false;
428428
}
429429

430430
if (Z_STRLEN_P(option) >= MAXPATHLEN) {
431-
zend_type_error("Option \"add_path\" must be less than %d bytes", MAXPATHLEN - 1);
431+
zend_value_error("Option \"add_path\" must be less than %d bytes", MAXPATHLEN - 1);
432432
return false;
433433
}
434434
opts->add_path_len = Z_STRLEN_P(option);

0 commit comments

Comments
 (0)