diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-10-26 13:25:22 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2018-10-31 08:21:34 +0000 |
commit | f89ee32437461f64fd3228acb9bc665df3f0ca42 (patch) | |
tree | 76a480f888827d7c65141b192e994bd8f0c66a58 /src/qml/jsapi/qjsengine.cpp | |
parent | f46f8745053208e4a86fa65e039179b85d5c317b (diff) |
Clarify documentation about throwError and the specific error types
Elaborate a bit on some specific types, suggest the use of the overload
and omit some values that either exist only to complete the enum for API
standard purposes (NoError) or exist only for porting purposes but are
not relevant in use (EvalError).
Change-Id: I4f9cf7a4605305642fc20570a90a16f2c29d8b98
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Richard Weickelt <richard@weickelt.de>
Diffstat (limited to 'src/qml/jsapi/qjsengine.cpp')
-rw-r--r-- | src/qml/jsapi/qjsengine.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qml/jsapi/qjsengine.cpp b/src/qml/jsapi/qjsengine.cpp index 3bde6a60c4..aab72f8b2d 100644 --- a/src/qml/jsapi/qjsengine.cpp +++ b/src/qml/jsapi/qjsengine.cpp @@ -927,6 +927,10 @@ bool QJSEngine::convertV2(const QJSValue &value, int type, void *ptr) } \endcode + If you need a more specific run-time error to describe an exception, you can use the + \l {QJSEngine::}{throwError(QJSValue::ErrorType errorType, const QString &message)} + overload. + \since Qt 5.12 \sa {Script Exceptions} */ @@ -936,6 +940,8 @@ void QJSEngine::throwError(const QString &message) } /*! + \overload throwError() + Throws a run-time error (exception) with the given \a errorType and \a message. |