__SET_LIBERROR(3pub)

πŸ’– __SET_LIBERROR(3pub) πŸ’–

okay bestie, welcome to the publib corner of the manual β€” this is __SET_LIBERROR(3pub), section 3pub, and it's about to teach you how to change your whole error-handling vibe ✨


πŸŽ€ NAME πŸŽ€

__set_liberror β€” modify error handling for publib 🫢


✨ SYNOPSIS ✨

#include <publib.h>

void __set_liberror(enum __liberror);

like. that's it. one header, one function, one argument. iconic minimalism πŸ’…


🌸 DESCRIPTION 🌸

so here's the tea, bestie πŸ“

unless the documentation for a specific function says otherwise, the default thing that happens when a library function notices an error is that it aborts whatever it was doing and returns an error indication. very "nope, we're done here" energy 😭

but you can change that behaviour! that's literally what __set_liberror(3) is for πŸ¦‹

the argument you pass should be a bitwise OR of these values:

  • __abort_on_error
  • __exit_on_error
  • __complain_on_error
⚠️ okay this part is important, no cap: __abort_on_error and __exit_on_error are mutually exclusive. only use one of them. do not be the girl who ORs both together. it's giving chaos πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯


πŸ‘‘ AUTHOR πŸ‘‘

Lars Wirzenius (lars.wirzenius@helsinki.fi) β€” the actual main character who wrote this 🌈⭐


and that's the whole page, bestie!! go forth and configure your error handling with confidence πŸ’œπŸŽ€πŸ¦‹

this has been __SET_LIBERROR(3pub) from the publib manual β€” mwah, slay, periodt πŸ’–βœ¨

πŸ“¦ where this page comes from