From 9ca45584588c2231f34252f9fc17485185485012 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Wed, 24 Aug 2011 19:06:20 +0200 Subject: component script constructor can cause an exception forward this Change-Id: If49829105abe7463278837d871c63ea3fd89564f Reviewed-on: http://codereview.qt.nokia.com/3529 Reviewed-by: Qt Sanity Bot Reviewed-by: Karsten Heimrich --- installerbuilder/libinstaller/component.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'installerbuilder/libinstaller') diff --git a/installerbuilder/libinstaller/component.cpp b/installerbuilder/libinstaller/component.cpp index 57a9c105f..0ab9987f7 100644 --- a/installerbuilder/libinstaller/component.cpp +++ b/installerbuilder/libinstaller/component.cpp @@ -379,6 +379,12 @@ void Component::loadComponentScript(const QString &fileName) d->m_scriptComponent.construct(); } + //evaluate("Component") and construct can have an exception + if (d->m_scriptEngine.hasUncaughtException()) { + throw Error(tr("Exception while loading the component script %1") + .arg(uncaughtExceptionString(&(d->m_scriptEngine)/*, QFileInfo(file).absoluteFilePath()*/))); + } + emit loaded(); languageChanged(); -- cgit v1.2.3