On 9/17/24 12:55, Geoff Simmons wrote:
On 9/17/24 11:54, Carlos Abalde wrote:
I'm looking for advise / best-practices related to VMODs, objects and
their __init() constructors.
What's your suggestion to handle errors in the constructor?
if (failure) {
VRT_fail(ctx, "printf-like format %string", args, ...);
return;
}
When VRT_fail() is invoked during the function implementing the
constructor, the execution of vcl_init is aborted, and the VCL load
fails.
Oh! I've being using 'VRT_fail()' to handle as 503 responses
unrecoverable VMOD error conditions during normal operation, but I
didn't know / considered it could be using also for initializations.
Thanks for the tip!
Best,
--
Carlos Abalde
_______________________________________________
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev