JE::Ob...::Error(3pm)

πŸ“¦
version 0.066 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– JE::Ob...::Error(3pm) πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation β€” section 3pm, aka perl module manpages. Pull up a chair, we're talking about JavaScript error objects and honestly? iconic behavior. πŸ¦‹


✨ NAME ✨

JE::Object::Error β€” the JavaScript Error object class. yeah. that one. πŸ’…


✨ SYNOPSIS ✨

use JE::Object::Error;

# Somewhere in code called by an eval{}
die new JE::Object::Error $global, "(Error message here)";

# Later:
$@->prop('message');  # error message
$@->prop('name');     # 'Error'
"$@";                 # 'Error: ' plus the error message

so like, you use it, you die with one of these bad boys from inside something an eval{} is running, and then later you can poke at $@ and it will just tell you things. the way that "$@" stringifies into the full Error: situation?? obsessed. 😭


✨ DESCRIPTION ✨

This class implements JavaScript Error objects for JE. No cap. πŸ’œ

It's the base class for all of JavaScript's native error objects β€” like, the whole family tree starts here. (scroll down to SEE ALSO if you wanna meet the relatives πŸ‘‘)


✨ METHODS ✨

head over to JE::Types for the lowdown on most of the methods, bestie β€” that's where the general stuff lives. only the stuff that's specific to JE::Object::Error gets explained right here. 🌸

The value method returns the string 'Error: ' followed by the error message. and for subclasses? the 'Error' part gets swapped out for the class name β€” which is literally just whatever ->class hands back. so like, it knows its own name. main character energy fr fr. πŸ‘‘


✨ SEE ALSO ✨

  • JE
  • JE::Object
  • JE::Object::Error::RangeError
  • JE::Object::Error::SyntaxError
  • JE::Object::Error::TypeError
  • JE::Object::Error::URIError
  • JE::Object::Error::ReferenceError

the whole error-object friend group 🫢 go say hi.


and that's the page!! this one shipped as perl v5.36.0, dated 2023-08-25 πŸ’– slay, go catch some errors, ily, bye πŸŽ€βœ¨

πŸ“¦ where this page comes from