diff options
| author | Teddy Wing | 2021-02-27 16:48:40 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2021-02-27 16:48:40 +0100 | 
| commit | 20cbc406fd3e162ff3ff44ddd779a406fceea0f7 (patch) | |
| tree | ac5c6b6ed06c5bfa299ff4b20ffd1fbaa927e7d8 /l/src | |
| parent | 17426317b3d6b51b1d453e6c56f59d7d90290677 (diff) | |
| download | extreload-20cbc406fd3e162ff3ff44ddd779a406fceea0f7.tar.bz2 | |
ws-on-message: Move predicate checking tab reload exception to function
Give this check a name.
Diffstat (limited to 'l/src')
| -rw-r--r-- | l/src/devtools-protocol.lisp | 4 | ||||
| -rw-r--r-- | l/src/main.lisp | 2 | 
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. | 
