diff options
author | Sze Howe Koh <szehowe.koh@gmail.com> | 2015-04-15 07:45:03 +0800 |
---|---|---|
committer | Sze Howe Koh <szehowe.koh@gmail.com> | 2015-04-18 00:24:05 +0000 |
commit | aa1524a4dde5098da2c9e40eb60bbaecf69bbe1c (patch) | |
tree | 37a7f1d5b7d3ec43e1153cf9eb3d0b1625b887e3 /src/qml/doc/snippets/code/src_script_qjsengine.cpp | |
parent | 34bd29fa9b1b6b195b16c55c0b97dfc85d448683 (diff) |
Doc: Expand on QJSEngine exception handling
- List the properties provided by the Error object. They consist of the
standard properties and a subset of the Mozilla extensions.
- Add QJSValue::property() usage to the example code.
- Add cross-referencing.
- Some rephrasing for clarity and conciseness.
Change-Id: I1eb6943899fee2bd81851ccb03660a7a474a975d
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/qml/doc/snippets/code/src_script_qjsengine.cpp')
-rw-r--r-- | src/qml/doc/snippets/code/src_script_qjsengine.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/doc/snippets/code/src_script_qjsengine.cpp b/src/qml/doc/snippets/code/src_script_qjsengine.cpp index 315df2c23f..c9bd7dfcd9 100644 --- a/src/qml/doc/snippets/code/src_script_qjsengine.cpp +++ b/src/qml/doc/snippets/code/src_script_qjsengine.cpp @@ -74,7 +74,10 @@ QJSValue myNumberPlusOne = myEngine.evaluate("myNumber + 1"); //! [4] QJSValue result = myEngine.evaluate(...); if (result.isError()) - qDebug() << "uncaught exception:" << result.toString(); + qDebug() + << "Uncaught exception at line" + << result.property("lineNumber").toInt() + << ":" << result.toString(); //! [4] |