I can't find an example of a vmod's function indicating an error --
other than returning NULL in std.readfile().
Besides normal results, my vmod's functions can fail due to a number of
reasons and I'd like to be able to, at least, indicate them to the
caller (vcl_recv) so an intelligent status can be returned to the
client: some times the error ought to be 403 (my module checks
credentials), and some times it must be 500 (internal error, an
exception), for example.
Currently I log such exceptions with syslog(3) and return a static
string to vcl_recv. But then there is no (easy) way to distinguish the
kinds of failures...
Is there a proper way to do this? Something like SetStatus(sp, int
status, const char *format, ...)? Thanks!
-mi
_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc