AuSetErrorHandler(3)

✨ AuSetErrorHandler ✨

ok so bestie, welcome to AuSetErrorHandler(3) β€” it's a Library Functions Manual page, it's giving very much "let me hold your hand while your audio server has a lil oopsie" πŸ’–


🌸 Name 🌸

AuSetErrorHandler β€” set nonfatal error handler. that's it, that's the whole job. no cap. πŸ’…


πŸŽ€ Synopsis πŸŽ€

#include <audio/audiolib.h>

AuBool (*AuSetErrorHandler(server, handler))()
    AuServer *server;
    AuBool (*handler)(AuServer *, AuErrorEvent *);

look at that function-pointer-of-a-function-pointer situation. it's giving main character energy. 😭✨


πŸ¦‹ Arguments πŸ¦‹

  • server β€” the connection to the audio server. like, which server are we talking to, bestie? πŸ‘‘
  • handler β€” the non-fatal error handler you want installed. pass NULL if you want to reinstall the default handler instead. yes, NULL is a valid vibe here. 🫢

πŸ’œ Description πŸ’œ

so what AuSetErrorHandler does is: it sets the non-fatal error handler and hands you back the previous handler. two-for-one, obsessed. πŸ”₯

this error handler gets invoked whenever a non-fatal error (error event) is received. and because this condition is not assumed to be fatal, it is totally acceptable for the error handler to return. no dramatic exit required, it can just come back. 😌

⚠️ but lowkey important: the error handler should not call any functions (directly or indirectly) on the server that will generate protocol requests, or that will look for input events. fr fr, don't do it. it's not the moment. πŸš«πŸ’€

🌈 See Also 🌈

  • AuServerName
  • AuGetErrorDatabaseText
  • AuGetErrorText
  • AuSetIOErrorHandler
  • AuSynchronize

audiolib β€” Network Audio System C Language Interface


ok that's the whole page, bestie, you ate that πŸ“βœ¨ this was from the audiolib error handling corner of the manual, version 1.9.4, and yep it's still the AuSetErrorHandler(3) page. go forth and handle your errors non-fatally πŸ’–πŸ§šβ€β™€οΈπŸŽ€

πŸ“¦ where this page comes from