I misunderstood the spec when I implemented this, so we either return a "value" key with the result in case of success or the error object as the body in case of error. We should always add a "value" key to the body and set it with either the result or the error object. https://w3c.github.io/webdriver/webdriver-spec.html#dfn-send-an-error Last step is "send a response", which is the same as when there's no error.
Created attachment 321190 [details] Patch
Comment on attachment 321190 [details] Patch r=me
Committed r222255: <http://trac.webkit.org/changeset/222255>
<rdar://problem/34693192>