aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--l/src/devtools-protocol.lisp4
-rw-r--r--l/src/main.lisp2
2 files changed, 5 insertions, 1 deletions
diff --git a/l/src/devtools-protocol.lisp b/l/src/devtools-protocol.lisp
index 8b41330..2d67033 100644
--- a/l/src/devtools-protocol.lisp
+++ b/l/src/devtools-protocol.lisp
@@ -34,6 +34,10 @@
"Returns true if `message` is a response to `Runtime.evaluate`."
(jsown:keyp (json-obj-get message "result") "sessionId"))
+(defun runtime-evaluate-exception-p (message)
+ "Returns true if `message` describes a runtime exception"
+ (jsown:keyp (json-obj-get message "result") "exceptionDetails"))
+
(defun parse-get-targets-response (response)
"Parses a list of target info objects from the response to `Target.getTargets`."
(let* ((result (json-obj-get response "result"))
diff --git a/l/src/main.lisp b/l/src/main.lisp
index 9eaa8e3..61a48be 100644
--- a/l/src/main.lisp
+++ b/l/src/main.lisp
@@ -78,7 +78,7 @@
"sessionId")))
;; Failed to reload tab.
- (when (jsown:keyp (json-obj-get response "result") "exceptionDetails")
+ (when (runtime-evaluate-exception-p response)
;; `reload-tab` adds an extra increment to the wait group. If the call
;; fails, we only receive one message instead of two, so the wait group
;; must be decremented to match.