History

Review fix: add flag to choose whether to abort script on exception

Dale Glass committed 3 years ago

Commit acd19f71 parent aec756b4 files · +34 −6Browse files

Showing the changes to libraries/script-engine/src/ScriptManager.cpp (1 of 4 files). Show all

Unified · Split

libraries/script-engine/src/ScriptManager.cpp+5−4
@@ -305,9 +305,10 @@ ScriptManager::ScriptManager(Context context, const QString& scriptContents, con · 304 unmodified lines
305 }305 }
306 306
307 // Unhandled exception kills the running script307 // Unhandled exception kills the running script
308 stop(false);308 if (_abortOnUncaughtException) {
309 309 stop(false);
310 logException(output);310 logException(output);
311 }
311 });312 });
312#endif313#endif
313 314
@@ -909,7 +910,7 @@ void ScriptManager::run() { · 595 unmodified lines
909 PROFILE_RANGE(script, _fileNameString);910 PROFILE_RANGE(script, _fileNameString);
910 _returnValue = _engine->evaluate(_scriptContents, _fileNameString);911 _returnValue = _engine->evaluate(_scriptContents, _fileNameString);
911 912
912 if (_engine->hasUncaughtException()) {913 if (_engine->hasUncaughtException() && _abortOnUncaughtException) {
913 914
914 qCWarning(scriptengine) << "Engine has uncaught exception, stopping";915 qCWarning(scriptengine) << "Engine has uncaught exception, stopping";
915 stop();916 stop();