Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Error Handling · Automation Design

Direct answer

Error handling in automation design decides upfront how each step reacts to failure — stop, retry, skip or compensate — and ensures errors are logged with enough context to fix them.

When to use this

Use this when designing how each step handles failure.

First 30 seconds

1. Handle errors explicitly: catch, log with context, clean up, return failure.

2. Don't swallow errors.

3. Distinguish retryable and fatal.

4. Rollback when needed.

5. Alert owners.

Operational verification

error → classify → handle/rollback → report

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
automation architecture and design
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformautomation architecture and design · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when designing how each step handles failure.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Common mistakes Narrow the fault
  • Bare except: that hides errors.
  • ignore_errors: true on tasks that matter.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Decide per step whether to stop, retry, skip or compensate.
  • Every error log must name the step, target and cause.
  • After a failure the system must be in a known state.
Key checks
  • Try/except or block/rescue in code — handling
  • Error messages with context — diagnostics
  • Non-zero exit on failure — signal
ReferenceWhy it matters1 section · depth on demand

What it is

Error handling decides what happens when a step fails: stop, retry, skip, or roll back. Every external call should have a timeout and a defined error path, and errors should be reported with enough context to act on.

ReferenceImportant terms & boundaries2 sections · depth on demand

Example

try:
    r = requests.get(url, timeout=10)
    r.raise_for_status()
except requests.RequestException as exc:
    log.error("inventory fetch failed: %s", exc)
    sys.exit(2)

In depth

Error handling decides what an automation does when a step does not go as planned: stop, retry, skip, roll back or alert. The worst outcome is the silent one — a step fails, the script carries on, and later steps act on a broken state. Good error handling makes every failure visible and leaves the system in a known state.

Design rules:

  • Fail by default; continue only where a failure is explicitly harmless.
  • Distinguish transient errors (timeouts, rate limits — retry) from permanent ones (bad input, permission denied — stop).
  • Report the step, target, input and error message, not just "failed".
  • Clean up partial work, or record exactly what was left behind.
set -euo pipefail
trap 'echo "Failed at line $LINENO: $BASH_COMMAND" >&2' ERR
try:
    push_config(device)
except TimeoutError:
    retry_later(device)
except PermissionError as e:
    log.error("auth failed on %s: %s", device, e); raise
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docautomation architecture and design current

Authoritative/upstream documentation reviewed for bounded claims in Automation Design > Error Handling. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://learn.microsoft.com/en-us/azure/well-architected/operational-excellence/enable-automation · confidence 94%
Confirmation

Confirm action

Continue?