mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-18 16:17:03 +00:00
feat(GODT-2446): Attach logs to sentry reports for relevant bridge-gui exceptions.
Cherry picked from release/perth_narrows (2aa4e7c)
# Conflicts:
# internal/frontend/bridge-gui/bridge-gui/AppController.cpp
# internal/frontend/bridge-gui/bridge-gui/AppController.h
# internal/frontend/bridge-gui/bridge-gui/LogUtils.cpp
# internal/frontend/bridge-gui/bridge-gui/LogUtils.h
# internal/frontend/bridge-gui/bridge-gui/QMLBackend.cpp
# internal/frontend/bridge-gui/bridge-gui/SentryUtils.cpp
# internal/frontend/bridge-gui/bridge-gui/SentryUtils.h
# internal/frontend/bridge-gui/bridge-gui/main.cpp
This commit is contained in:
@ -90,20 +90,14 @@ Settings &AppController::settings() {
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] function The function that caught the exception.
|
||||
/// \param[in] message The error message.
|
||||
/// \param[in] details The details for the error.
|
||||
/// \param[in] exception The exception that triggered the fatal error.
|
||||
//****************************************************************************************************************************************************
|
||||
void AppController::onFatalError(QString const &function, QString const &message, QString const &details) {
|
||||
QString fullMessage = QString("%1(): %2").arg(function, message);
|
||||
if (!details.isEmpty()) {
|
||||
fullMessage += "\n\nDetails:\n" + details;
|
||||
}
|
||||
sentry_uuid_s const uuid = reportSentryException(SENTRY_LEVEL_ERROR, "AppController got notified of a fatal error", "Exception",
|
||||
fullMessage.toLocal8Bit());
|
||||
QMessageBox::critical(nullptr, tr("Error"), message);
|
||||
void AppController::onFatalError(Exception const &exception) {
|
||||
sentry_uuid_t uuid = reportSentryException("AppController got notified of a fatal error", exception);
|
||||
|
||||
QMessageBox::critical(nullptr, tr("Error"), exception.what());
|
||||
restart(true);
|
||||
log().fatal(QString("reportID: %1 Captured exception: %2").arg(QByteArray(uuid.bytes, 16).toHex(), fullMessage));
|
||||
log().fatal(QString("reportID: %1 Captured exception: %2").arg(QByteArray(uuid.bytes, 16).toHex(), exception.detailedWhat()));
|
||||
qApp->exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user