summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlvme.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-05-06 01:22:52 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-05-06 01:22:52 (GMT)
commit2ae61bfcbb3f93904ecc3c1241a1743c44f0f555 (patch)
tree8c0afefdfcd41ef13148266f89efb7a8d1b65b98 /src/declarative/qml/qmlvme.cpp
parent547223a4f31067ed34acabd9a2d8a0b7645fd3f8 (diff)
downloadQt-2ae61bfcbb3f93904ecc3c1241a1743c44f0f555.zip
Qt-2ae61bfcbb3f93904ecc3c1241a1743c44f0f555.tar.gz
Qt-2ae61bfcbb3f93904ecc3c1241a1743c44f0f555.tar.bz2
Improve error handling
If a sub-component causes an error during creation we propagate those errors to the instantiating component.
Diffstat (limited to 'src/declarative/qml/qmlvme.cpp')
-rw-r--r--src/declarative/qml/qmlvme.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp
index ee7a881..82df3bc 100644
--- a/src/declarative/qml/qmlvme.cpp
+++ b/src/declarative/qml/qmlvme.cpp
@@ -170,7 +170,6 @@ static inline int qIndexOfProperty(QObject *o, const char *name)
}
QmlVME::QmlVME()
-: exceptionLine(-1)
{
}
@@ -261,8 +260,12 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in
QFxCompilerTimer<QFxCompiler::InstrCreateObject> cc;
#endif
QObject *o = types.at(instr.create.type).createInstance(QmlContext::activeContext());
- if (!o)
+ if (!o) {
+ if(types.at(instr.create.type).component)
+ vmeErrors << types.at(instr.create.type).component->errors();
+
VME_EXCEPTION("Unable to create object of type" << types.at(instr.create.type).className);
+ }
if (instr.create.data != -1) {
QmlCustomParser *customParser =