diff options
| author | Jesper K. Pedersen <jesper.pedersen@kdab.com> | 2013-04-17 14:52:52 +0200 |
|---|---|---|
| committer | Jesper K. Pedersen <jesper.pedersen@kdab.com> | 2013-04-17 20:50:44 +0200 |
| commit | cf9aee24f52704f70a5cb59e8cf15258d7e17445 (patch) | |
| tree | ad01aa7a3ca1d3bf25e844b061cd88678b4874a9 /scriptmanager.cpp | |
| parent | 487770e422e4c55e128c210bb82b30ed99f3f401 (diff) | |
improved error handling
Change-Id: I3cd3632c17fb542cb0ab32a2ebebfc3c780aae22
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Diffstat (limited to 'scriptmanager.cpp')
| -rw-r--r-- | scriptmanager.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/scriptmanager.cpp b/scriptmanager.cpp index 882839c..00b5b91 100644 --- a/scriptmanager.cpp +++ b/scriptmanager.cpp @@ -150,12 +150,13 @@ void ScriptManager::runFile(const QString &fileName) Core::MessageManager::instance()->showOutputPane(); Core::MessageManager::instance()->printToOutputPane(tr("Start %1...").arg(fileName), Utils::NormalMessageFormat); - if(m_runner->runScript(sourceCode, fileName)) + ErrorMessage message = m_runner->runScript(sourceCode, fileName); + if (message.hasError) + Core::MessageManager::instance()->printToOutputPane(tr("Error at line %1: %2\n").arg(message.line).arg(message.message), + Utils::ErrorMessageFormat); + else Core::MessageManager::instance()->printToOutputPane(tr("The script exited normally\n"), Utils::NormalMessageFormat); - else - Core::MessageManager::instance()->printToOutputPane(tr("The script has unexpectedly finished.\n"), - Utils::ErrorMessageFormat); } else { Core::MessageManager::instance()->printToOutputPane(tr("Error: %1 doesn't exist.\n").arg(fileName), |
