Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all
Unified · Split
| @@ -147,7 +147,12 @@ ScriptEngine::ScriptEngine(const QUrl& scriptURL, · 146 unmodified lines | ||
| 147 | 147 | QEventLoop loop; |
| 148 | 148 | QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit())); |
| 149 | 149 | loop.exec(); |
| 150 | − _scriptContents = reply->readAll(); | |
| 150 | + if (reply->error() == QNetworkReply::NoError && reply->attribute(QNetworkRequest::HttpStatusCodeAttribute) == 200) { | |
| 151 | + _scriptContents = reply->readAll(); | |
| 152 | + } else { | |
| 153 | + qDebug() << "ERROR Loading file:" << url.toString(); | |
| 154 | + emit errorMessage("ERROR Loading file:" + url.toString()); | |
| 155 | + } | |
| 151 | 156 | } |
| 152 | 157 | } |
| 153 | 158 | } |