Catman...sponse(3pm)

✨ Catmandu::AlephX::Response ✨

okay bestie, gather round πŸ’– this is Catmandu::AlephX::Response, aka the base class for xml-responses from the AlephX-server. she's the mom of the whole response family, she holds it down, no cap πŸ‘‘


🌸 NAME 🌸

Catmandu::AlephX::Response β€” the base class for xml-responses coming at you from the AlephX-server πŸ¦‹


✨ SYNOPSIS ✨

so like, every single response from the AlephX-server shares the same functionality and the same keys, periodt:

  • expressed in XML 🧚
  • the name of the parent element is equal to the parameter op, EXCEPT when the value in op isn't recognized β€” then it gets set to login πŸ’…
  • when an internal error happened, that error is reported in the key error 😭
  • the session-id is reported in the key session-id πŸŽ€
  • all the other subkeys are treated as data ⭐

Every public method from Catmandu::AlephX hands you back an object that's a subclass of Catmandu::AlepX::Response. And if there's a connection error, or the xml parsing goes sideways? Exceptions get thrown, bestie, no gentle landing πŸ™ˆ


πŸ’… methods πŸ’…

🫢 op

the type of op.

😭 error

the internal error that got reported in the xml response.

heads up: these errors only apply to values in your parameters. Other errors β€” like connection errors, or problems while parsing the xml response β€” get thrown as exceptions instead. So don't go looking for them here πŸ‘‘

πŸŽ€ session_id

the session-id of the current request.

⭐ is_success

this method only checks whether there was an internal error in the AlephX-response. so it literally just tests if the key error was undefined. that's it. that's the whole vibe check πŸ¦‹

and like, as said before: other errors are thrown as exceptions πŸ’€


lowkey important reminder: is_success is only about that error key β€” connection drama and xml parsing drama live in exception-land, not here πŸ™ˆ

perl v5.36.0, dated 2023-02-02 β€” that's the tea, bestie, the manpage said it, I said it, and we're both slaying πŸ’–βœ¨πŸŽ€πŸ¦‹πŸ‘‘

πŸ“¦ where this page comes from