Skip to content

Conversation

@kocsismate
Copy link
Member

No description provided.

ext/bz2/bz2.c Outdated

if (CHECK_ZVAL_NULL_PATH(file)) {
zend_type_error("Filename must not contain null bytes");
zend_argument_value_error(1, "must not contain null bytes");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or should I change it back to a type error?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the value error is the proper way to go here, at least from a logical stand point

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My feelings as well! P.S. null byte errors are 50-50% TypeErrors and ValueErrors in the codebase, so we'll have to adapt them accordingly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is a type error because the ZPP PATH (P modifier) which is used to check for strings without any null bytes so I would imagine that would need to change too in that case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these are type error because of zpp. And I think it's a type error in that case, because zpp always throws TypeError (even ArgumentCountError is a sub-class of TypeError, despite that not making any sense)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you all for the explanation! I've just changed it back to TypeError

@carusogabriel
Copy link
Contributor

@kocsismate Do you mind if I label all these PRs with a dedicated label?

Something like Improve Error Messages? So in the feature, we can easily find these PRs :)

@kocsismate
Copy link
Member Author

@carusogabriel No, not at all! Feel free :)

@kocsismate kocsismate force-pushed the consistent-error-messages3-various branch 2 times, most recently from 093cf4a to 699c4fb Compare March 19, 2020 10:33
@carusogabriel
Copy link
Contributor

I don't have permissions on GitHub to create it 😕

If someone can create, please, I'd appreciated it.

@kocsismate kocsismate force-pushed the consistent-error-messages3-various branch from 699c4fb to 074547e Compare March 23, 2020 14:42
@kocsismate kocsismate force-pushed the consistent-error-messages3-various branch from 074547e to fdf1401 Compare March 23, 2020 16:22
@php-pulls php-pulls closed this in 01b266a Mar 23, 2020
@kocsismate kocsismate deleted the consistent-error-messages3-various branch March 23, 2020 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants