<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>On 9/17/24 12:55, Geoff Simmons wrote:</p>
<blockquote type="cite"
cite="mid:0265a6f5-6fd2-41a0-b51b-e2e4ee20a5b1@uplex.de">On
9/17/24 11:54, Carlos Abalde wrote:
<br>
<blockquote type="cite">
<br>
I'm looking for advise / best-practices related to VMODs,
objects and their __init() constructors.
<br>
What's your suggestion to handle errors in the constructor?
<br>
</blockquote>
if (failure) {
<br>
VRT_fail(ctx, "printf-like format %string", args, ...);
<br>
return;
<br>
}
<br>
<br>
When VRT_fail() is invoked during the function implementing the
constructor, the execution of vcl_init is aborted, and the VCL
load fails.
<br>
</blockquote>
<p>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!<span
style="white-space: pre-wrap">
</span></p>
<div class="moz-signature">Best,</div>
<div class="moz-signature"><br>
</div>
<div class="moz-signature">-- <br>
Carlos Abalde</div>
</body>
</html>