错误处理-自动重试
发生错误后自动重试
问题背景
发生错误后自动重试操作
解决方案
使用 捕获错误 节点接收错误并将其连接回需要重试操作的节点。
示例

示例JSON
[{"id":"27e61f12.c1a15","type":"inject","z":"e028a121bc4ae061","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":350,"y":2960,"wires":[["fd44d65b8bce6257"]]},{"id":"f22b1e9a.5d89b","type":"debug","z":"e028a121bc4ae061","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":760,"y":2960,"wires":[]},{"id":"2166290d.98d736","type":"delay","z":"e028a121bc4ae061","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":490,"y":3020,"wires":[["fd44d65b8bce6257"]]},{"id":"139b836e.7950ed","type":"catch","z":"e028a121bc4ae061","name":"","scope":["fd44d65b8bce6257"],"uncaught":false,"x":320,"y":3020,"wires":[["2166290d.98d736","9c8ab214.0ecaa"]]},{"id":"9c8ab214.0ecaa","type":"debug","z":"e028a121bc4ae061","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"error","targetType":"msg","x":490,"y":3080,"wires":[]},{"id":"fd44d65b8bce6257","type":"MySQL","z":"e028a121bc4ae061","name":"","queryOptType":"editor","queryOpt":"sqlStr","paramsOptType":"none","paramsOpt":"queryParams","parseMustache":true,"outField":"payload","query":"","x":560,"y":2960,"wires":[["f22b1e9a.5d89b"]]}]
运行结果
点击 注入 节点的按钮,触发 MySQL 节点抛出错误,捕获错误 节点捕获错误,通过 延迟 节点 延时2s 后再次触发 MySQL 执行
