Skip to content

Commit 07b78c8

Browse files
committed
WIP backtrace for errors outside expect
1 parent d880439 commit 07b78c8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

buttercup.el

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,15 +2129,19 @@ ARGS according to `debugger'."
21292129
;; When the error occurs in the calling of one of the
21302130
;; wrapped expressions of an expect.
21312131
(buttercup--wrapper-fun-p (cadr frame))
2132-
;; TODO: When an error happens in code called outside an expect
2132+
;; When an error happens in code called outside an expect
21332133
;; buttercup--update-with-funcall
21342134
;; apply buttercup--funcall
21352135
;; buttercup--funcall - sets debugger
21362136
;; apply FUNCTION
21372137
;; FUNCTION -- spec body function
21382138
;; condition-case -- from buttercup-with-converted-ert-signals
2139-
;; progn -- the same
2139+
;; (let ((buttercup--stackframe-marker 1)) -- the same
21402140
;; ACTUAL CODE
2141+
(and (null (car frame))
2142+
(eq 'let (cadr frame))
2143+
(equal '((buttercup--stackframe-marker 1)) (caddr frame))
2144+
)
21412145
;; TODO: What about an error in a matcher?
21422146
;; TODO: What about :to-throw?
21432147
;; TODO: What about signals in before and after blocks?
@@ -2192,7 +2196,9 @@ Specifically, `ert-test-failed' is converted to
21922196
`buttercup-pending'."
21932197
(declare (indent 0))
21942198
`(condition-case err
2195-
(progn ,@body)
2199+
(let ((buttercup--stackframe-marker 1))
2200+
(ignore buttercup--stackframe-marker)
2201+
,@body)
21962202
(ert-test-failed
21972203
(buttercup-fail "%S" err))
21982204
(ert-test-skipped

0 commit comments

Comments
 (0)