on_error
on_error(err, ctx) runs when a scrape cycle fails. Defined in defer.lua.
Signature
Section titled “Signature”function on_error(err, ctx) -> voidParameters
Section titled “Parameters”| Field | Type | Description |
|---|---|---|
err |
string | Error message describing the failure |
ctx |
table | The cycle context table |
Returns
Section titled “Returns”None.
Example
Section titled “Example”function on_error(err, ctx) notify("Scrape failed", err, 5000) log("Error: " .. err)endSee Also
Section titled “See Also”- on_success - Called when cycle succeeds
- on_finally - Always called after success or error