Get JavaScript errors coming from WKWebView
<p>I implemented the <code>WKScriptMessageHandler</code> protocol and I have defined the <code>userContentController(:didReceiveScriptMessage:)</code> method.</p>

<p>When there is a error in the Javascript, I get (in the <code>WKScriptMessage</code> object) something not really useful like:</p>

<pre><code>{
    col = 0;
    file = "";
    line = 0;
    message = "Script error.";
    type = error;
}
</code></pre>

<p>On the other hand, if I open the Safari Web Inspector, I can see the real error which is (for instance):</p>

<p><code>TypeError: FW.Ui.Modal.sho is not a function. (In 'FW.Ui.Modal.sho', 'FW.Ui.Modal.sho' is undefined)</code></p>

<p>Is there a way to get that error back in my native code?</p>

<p><strong>EDIT:</strong>
Just to clarify, the javascript code is written by a javascript developer (who doesn't have access to the native source code, so he can't debug the app via Xcode). The code he writes it's then pushed to the iOS app (downloaded from an enterprise app store).</p>