Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize error sections in DOM #4225

Open
nielsdos opened this issue Dec 2, 2024 · 4 comments
Open

Normalize error sections in DOM #4225

nielsdos opened this issue Dec 2, 2024 · 4 comments

Comments

@nielsdos
Copy link
Member

nielsdos commented Dec 2, 2024

Many DOM error section just list the constant for the $code for DOMException, but don't actually say anywhere that it's a DOMException being thrown.

Although it should still be clear that for the old DOM classes, one can use DOMElement::$strictErrorChecking to make it work with warnings instead.

@ypoleto
Copy link

ypoleto commented Dec 3, 2024

Hey, Is there an example of error section with the problem?

@nielsdos
Copy link
Member Author

nielsdos commented Dec 4, 2024

Hi

If we take a look at this manual page https://www.php.net/manual/en/domcharacterdata.substringdata.php under the "Errors/Exceptions" section it says:

DOM_INDEX_SIZE_ERR

Raised if offset is negative or greater than the number of 16-bit units in data, or if count is negative.

However, it's not clear that this is a code within the DOMException class.
Annoyingly, the old DOM classes also allow to use warnings instead of exceptions, so this does not always throw and it depends on how the document was configured.
I'm not too sure myself how to clearly document this.

@ypoleto
Copy link

ypoleto commented Dec 6, 2024

I want to start this issue but I'm not very sure about how to start, do you have any ideas?

@Girgias
Copy link
Member

Girgias commented Dec 6, 2024

I don't think this is the best issue to start working on the documentation. I would recommend looking at one of the other Good First Issues to get familiar with the documentation conventions and the build process.

@nielsdos nielsdos removed the good first issue Good for newcomers label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants