CSS::D...ception(3pm)
π CSS::DOM::Exception β the manual page, bestie edition π
okay so you're reading CSS::D...ception(3pm), which is the User Contributed Perl Documentation version of CSS::DOM::Exception, and honestly? she's giving chaos management for CSS, and I'm obsessed. let's get into it π«Ά
β¨ NAME β¨
CSS::DOM::Exception β the Exception interface for CSS::DOM. no cap, that's literally her whole job π
πΈ SYNOPSIS πΈ
use CSS::DOM::Exception 'SYNTAX_ERR';
eval {
die new CSS::DOM::Exception
SYNTAX_ERR,
'1 is not a valid property declaration'
};
$@ == SYNTAX_ERR; # true
print $@; # prints "1 is not a valid property declaration\n";
see how she just throws? iconic behavior fr fr β¨
π¦ DESCRIPTION π¦
This module implements the W3C's DOMException interface. (yes, "implementations" is what the original says, we don't gatekeep grammar here, we gatekeep functionality π)
CSS::DOM::Exception objects stringify to the message that was passed to the constructor, and they numify to the error number. where do you find that error number, you ask? look below, under EXPORTS. iykyk π
π METHODS π
new CSS::DOM::Exception $type, $messageβ this class method creates a brand new exception object, like a little baby error πΌ.$typeis expected to be an integer (you can totally use the constants listed under EXPORTS for this, they're right there bestie).$messageis the error message. that's it. that's the whole method. slay β¨
π EXPORTS π
The following constants are optionally exported. and the descriptions? copied straight from the DOM spec, so you know they're legit. let's go one by one, no skipping, we don't do that here π
INDEX_SIZE_ERR(1) β if index or size is negative, or greater than the allowed value. she said "out of bounds? not on my watch" π«DOMSTRING_SIZE_ERR(2) β if the specified range of text does not fit into aDOMString. too much text, not enough string, it's giving "your luggage doesn't fit in the overhead bin" πHIERARCHY_REQUEST_ERR(3) β if any node is inserted somewhere it doesn't belong. like me at a party i wasn't invited to πWRONG_DOCUMENT_ERR(4) β if a node is used in a different document than the one that created it (that doesn't support it). cheating on your document?? in THIS economy?? πINVALID_CHARACTER_ERR(5) β if an invalid character is specified, such as in a name. bestie that character is NOT on the guest list πNO_DATA_ALLOWED_ERR(6) β if data is specified for a node which does not support data. she's a node who said "no data please" and we respect her boundaries π«ΆNO_MODIFICATION_ALLOWED_ERR(7) β if an attempt is made to modify an object where modifications are not allowed. read-only era. locked. do not perceive her πNOT_FOUND_ERR(8) β if an attempt was made to reference a node in a context where it does not exist. she's not here, she never was here, who are you talking about πNOT_SUPPORTED_ERR(9) β if the implementation does not support the type of object requested. respectfully? no βINUSE_ATTRIBUTE_ERR(10) β if an attempt is made to add an attribute that is already inuse elsewhere. (yes, "inuse" as one word, that's the spec's typo and we're keeping it, character for character π) that attribute is TAKEN, move on πINVALID_STATE_ERR(11) β if an attempt is made to use an object that is not, or is no longer, usable. expired. past her prime. out of the rotation πSYNTAX_ERR(12) β if an invalid or illegal string is specified. this is the star of the SYNOPSIS, our main character πINVALID_MODIFICATION_ERR(13) β if an attempt is made to modify the type of the underlying object. you cannot rebrand her, she is who she is β¨NAMESPACE_ERR(14) β if an attempt is made to create or change an object in a way which is incorrect with regard to namespaces. namespace drama. we've all been there π¦INVALID_ACCESS_ERR(15) β if a parameter or an operation is not supported by the underlying object. access denied, bestie, no keycard, no entry πͺ
β SEE ALSO β
CSS::DOMHTML::DOM::Exception
go read those too, they're part of the friend group πΈ
and that's the whole page, bestie! this was perl v5.36.0, dated 2023-08-02, and yes she really did call herself CSS::D...ception(3pm) in the footer like the icon she is π bye ily, go handle your exceptions responsibly π₯π
π¦ where this page comes from
- debian trixie: libcss-dom-perl 0.17-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcss-dom-perl 0.17-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcss-dom-perl 0.17-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcss-dom-perl 0.17-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms