Without on_error() handler curl.get() will raise an error which then will interrupt execution of the plenary job. This interruption will result in timeout handling code triggering, introducing unneeded delay and ugly stack traces. Fix the problem by defining on_error() and callback() handlers and explicitly wait for job completion with pcall() and Job:wait(). This allows proper error handling and control over error messages. Because plenary's curl implementation mangles stderr data, use a local table to map select error codes to descriptive text messages. Also do not emit hard error when endpoint is not configured, use Utils.error().
10 KiB
10 KiB