branch: elpa/flamegraph
commit 3978c4252726d8b0cc305ad809a41687ea52942e
Author: Dmitry Gutov <[email protected]>
Commit: Dmitry Gutov <[email protected]>

    Error if node not found
---
 docs/make-screenshots.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/docs/make-screenshots.el b/docs/make-screenshots.el
index 0bd29a2dcd..e25973bb9f 100644
--- a/docs/make-screenshots.el
+++ b/docs/make-screenshots.el
@@ -70,14 +70,14 @@ Return (DESCRIBE-WINDOW . FLAMEGRAPH-WINDOW)."
   (let ((fg-buf (get-buffer (format "*Flamegraph: %s*" "CPU"))))
     (with-current-buffer fg-buf
       (let* ((target (alist-get mode flamegraph-shot--targets))
-             (node (flamegraph-shot--find flamegraph--top target)))
-        (when node
-          ;; Zoom to the selected frame's parent so the harness frames
-          ;; (normal-top-level … flamegraph-shot--profile) drop out.
-          (when-let* ((parent (profiler-calltree-parent node)))
-            (flamegraph--goto-root parent))
-          (flamegraph--describe-frame node flamegraph--grand-total nil
-                                      flamegraph--profiler-el-calls))))
+             (node (or (flamegraph-shot--find flamegraph--top target)
+                       (error "Frame %s not found in profile" target))))
+        ;; Zoom to the selected frame's parent so the harness frames
+        ;; (normal-top-level … flamegraph-shot--profile) drop out.
+        (when-let* ((parent (profiler-calltree-parent node)))
+          (flamegraph--goto-root parent))
+        (flamegraph--describe-frame node flamegraph--grand-total nil
+                                    flamegraph--profiler-el-calls)))
     (delete-other-windows (get-buffer-window fg-buf))
     (let* ((fg-win (get-buffer-window fg-buf))
            (help-win (split-window fg-win flamegraph-shot--pane-width 'left 
t)))

Reply via email to