<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QJSEngine and error line]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I'm using the new QJSEngine and I'm trying to get the error line number (in case of error of course).<br />
Currently I'm handling errors as documented:</p>
<ul>
<li>if (result.isError()) result.toString().toUtf8() ...</li>
</ul>
<h2>but actually, the string is very poor: e.g. "SyntaxError: Syntax error"<br />
I would like to get at least a line number. Contextual information would be also welcome.<br />
Is it possible with the QJSEngine? (I'm using Qt 5.3.0)</h2>
<p dir="auto">Dominique</p>
]]></description><link>https://forum.qt.io/topic/52908/qjsengine-and-error-line</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 23:16:58 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/52908.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 03 Apr 2015 08:21:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QJSEngine and error line on Tue, 07 Apr 2015 10:48:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/fober">@<bdi>fober</bdi></a><br />
Great! Thanks for sharing the answer.</p>
]]></description><link>https://forum.qt.io/post/268769</link><guid isPermaLink="true">https://forum.qt.io/post/268769</guid><dc:creator><![CDATA[JKSH]]></dc:creator><pubDate>Tue, 07 Apr 2015 10:48:45 GMT</pubDate></item><item><title><![CDATA[Reply to QJSEngine and error line on Tue, 07 Apr 2015 10:19:39 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for the pointer to the list.<br />
I've got the answer:<br />
<em>Try to access the properties "message", "fileName" and "lineNumber".<br />
if (result.isError())<br />
qDebug() &lt;&lt; result.property("fileName").toString();<br />
result is a JavaScript Error object iff isError returns true.</em></p>
]]></description><link>https://forum.qt.io/post/268763</link><guid isPermaLink="true">https://forum.qt.io/post/268763</guid><dc:creator><![CDATA[fober]]></dc:creator><pubDate>Tue, 07 Apr 2015 10:19:39 GMT</pubDate></item><item><title><![CDATA[Reply to QJSEngine and error line on Sun, 05 Apr 2015 09:53:59 GMT]]></title><description><![CDATA[<p dir="auto">Hi Dominique,</p>
<p dir="auto">It looks to me like a missing feature in QJSEngine. The <a href="http://doc.qt.io/qt-5/qjsengine.html#evaluate" target="_blank" rel="noopener noreferrer nofollow ugc">documentation</a> mentions line numbers, but the API doesn't seem to provide a way to retrieve it.</p>
<p dir="auto">I might have missed something though. I suggest taking this to the <a href="http://lists.qt-project.org/mailman/listinfo/interest" target="_blank" rel="noopener noreferrer nofollow ugc">Interest mailing list</a> -- subscribe to the list and post your question there. Qt engineers are active on this list, and they will be able to tell you if there's currently a way to do what you want. (If not, you can submit a feature request)</p>
]]></description><link>https://forum.qt.io/post/268540</link><guid isPermaLink="true">https://forum.qt.io/post/268540</guid><dc:creator><![CDATA[JKSH]]></dc:creator><pubDate>Sun, 05 Apr 2015 09:53:59 GMT</pubDate></item></channel></rss>