forked from qt-creator/qt-creator
CompilerExplorer: Improve error reporting
Displays network errors as disrupting, instead of just sending them to the log. Change-Id: If5a3dbb733f1433dcc2bcd0a52ad12d8ee3b85ef Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
#include <coreplugin/messagemanager.h>
|
||||||
|
|
||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
#include <texteditor/texteditor.h>
|
#include <texteditor/texteditor.h>
|
||||||
@@ -464,7 +465,8 @@ void CompilerWidget::doCompile()
|
|||||||
m_marks.append(mark);
|
m_marks.append(mark);
|
||||||
}
|
}
|
||||||
} catch (const std::exception &e) {
|
} catch (const std::exception &e) {
|
||||||
qCritical() << "Exception: " << e.what();
|
Core::MessageManager::writeDisrupting(
|
||||||
|
Tr::tr("Failed to compile: \"%1\"").arg(QString::fromUtf8(e.what())));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
#include "api/language.h"
|
#include "api/language.h"
|
||||||
#include "api/library.h"
|
#include "api/library.h"
|
||||||
|
|
||||||
|
#include <coreplugin/messagemanager.h>
|
||||||
|
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QFutureWatcher>
|
#include <QFutureWatcher>
|
||||||
#include <QNetworkAccessManager>
|
#include <QNetworkAccessManager>
|
||||||
@@ -207,8 +209,9 @@ void CompilerSettings::fillLibraries(const LibrarySelectionAspect::ResultCallbac
|
|||||||
cachedLibraries(lang) = watcher->result();
|
cachedLibraries(lang) = watcher->result();
|
||||||
fillFromCache();
|
fillFromCache();
|
||||||
} catch (const std::exception &e) {
|
} catch (const std::exception &e) {
|
||||||
qCritical() << e.what();
|
Core::MessageManager::writeDisrupting(
|
||||||
return;
|
Tr::tr("Failed to fetch libraries: \"%1\"")
|
||||||
|
.arg(QString::fromUtf8(e.what())));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
watcher->setFuture(future);
|
watcher->setFuture(future);
|
||||||
@@ -249,8 +252,9 @@ void SourceSettings::fillLanguageIdModel(const Utils::StringSelectionAspect::Res
|
|||||||
cachedLanguages() = watcher->result();
|
cachedLanguages() = watcher->result();
|
||||||
fillFromCache();
|
fillFromCache();
|
||||||
} catch (const std::exception &e) {
|
} catch (const std::exception &e) {
|
||||||
qCritical() << e.what();
|
Core::MessageManager::writeDisrupting(
|
||||||
return;
|
Tr::tr("Failed to fetch languages: \"%1\"")
|
||||||
|
.arg(QString::fromUtf8(e.what())));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
watcher->setFuture(future);
|
watcher->setFuture(future);
|
||||||
@@ -290,8 +294,9 @@ void CompilerSettings::fillCompilerModel(const Utils::StringSelectionAspect::Res
|
|||||||
|
|
||||||
fillFromCache(itCache);
|
fillFromCache(itCache);
|
||||||
} catch (const std::exception &e) {
|
} catch (const std::exception &e) {
|
||||||
qCritical() << e.what();
|
Core::MessageManager::writeDisrupting(
|
||||||
return;
|
Tr::tr("Failed to fetch compilers: \"%1\"")
|
||||||
|
.arg(QString::fromUtf8(e.what())));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
watcher->setFuture(future);
|
watcher->setFuture(future);
|
||||||
|
|||||||
Reference in New Issue
Block a user