From 16dfcf5dc293f74069ecc5586058d97ef8d19593 Mon Sep 17 00:00:00 2001 From: mironov-artem <91034374+mironov-artem@users.noreply.github.com> Date: Sat, 28 Mar 2026 00:54:57 +0400 Subject: [PATCH] Update 02-error-handling.md --- documentation/tutorials/02-error-handling.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/documentation/tutorials/02-error-handling.md b/documentation/tutorials/02-error-handling.md index 9c9d811..b923770 100644 --- a/documentation/tutorials/02-error-handling.md +++ b/documentation/tutorials/02-error-handling.md @@ -442,7 +442,19 @@ defmodule EmailService do # NEW: Backoff implementation @impl true def backoff(error, _arguments, context, _options) do + + # Hello! I'm studying the examples from the documentation and really like your work. + # I ran into an issue where, in backoff/4, the error argument is already wrapped in a Reactor.Error.Invalid.RunStepError struct, + # so the backoff delay never triggers and the execution falls through to another branch, running without any delay. + + # Unwrap the error if it's wrapped in a RunStepError + reason = case error do + %Reactor.Error.Invalid.RunStepError{error: inner} -> inner + _ -> error + end + + case reason do %{type: :network_timeout} -> # Exponential backoff for network issues retry_count = Map.get(context, :current_try, 0)