aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-08-13 14:16:21 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-08-14 17:45:41 +0000
commit8bebd12c1b0dc2565b80b1d0db2c39e451f5b751 (patch)
tree804571815ca8e144be61b26c0461b551f07da008 /src/qml/jsruntime/qv4engine.cpp
parentc671211390b1fd9fe19e04f531817c58d3616c19 (diff)
Improve error handling for non-existent file imports
Change-Id: Ic043d30738c97836cf6afada6ee7cade23bf50f9 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 6d5a43dd1f..dbe1441cfc 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -1636,8 +1636,10 @@ ReturnedValue ExecutionEngine::global()
QQmlRefPointer<CompiledData::CompilationUnit> ExecutionEngine::compileModule(const QUrl &url)
{
QFile f(QQmlFile::urlToLocalFileOrQrc(url));
- if (!f.open(QIODevice::ReadOnly))
+ if (!f.open(QIODevice::ReadOnly)) {
+ throwError(QStringLiteral("Could not open module %1 for reading").arg(url.toString()));
return nullptr;
+ }
const QString sourceCode = QString::fromUtf8(f.readAll());
f.close();