From 152621b85e5edfe2bc78065a665127026971d6bc Mon Sep 17 00:00:00 2001
From: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
Date: Mon, 25 Mar 2024 16:18:35 +0000
Subject: [PATCH] Clarify error message

---
 src/pathways.jl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/pathways.jl b/src/pathways.jl
index f243b12..81557a4 100644
--- a/src/pathways.jl
+++ b/src/pathways.jl
@@ -288,7 +288,8 @@ function walk_pathway!(seq::Sequence, walker::PathwayWalker, pulse_effects::Vect
     while !(walk_pathway!(seq, walker, pulse_effects, nreadout, current_TR * TR(seq)))
         new_nwait = length(pulse_effects) + nreadout[]
         if nwait == new_nwait
-            error("Pathway iterated through the whole sequence without seeing a valid pulse or readout. Terminating...")
+            not_seen = iszero(length(pulse_effects)) ? "readout" : "pulse"
+            error("Pathway iterated through the whole sequence without seeing a valid $not_seen. Terminating...")
         end
         nwait = new_nwait
 
-- 
GitLab