feat(GODT-2446): Attach logs to sentry reports for relevant bridge-gui exceptions.

This commit is contained in:
Xavier Michelon
2023-03-06 13:02:57 +01:00
parent 227bbf1c03
commit 2aa4e7c9da
13 changed files with 211 additions and 45 deletions

View File

@ -31,7 +31,8 @@ namespace bridgepp {
//****************************************************************************************************************************************************
class Exception : public std::exception {
public: // member functions
explicit Exception(QString qwhat = QString(), QString details = QString()) noexcept; ///< Constructor
explicit Exception(QString qwhat = QString(), QString details = QString(), QString function = QString(),
QByteArray attachment = QByteArray()) noexcept; ///< Constructor
Exception(Exception const &ref) noexcept; ///< copy constructor
Exception(Exception &&ref) noexcept; ///< copy constructor
Exception &operator=(Exception const &) = delete; ///< Disabled assignment operator
@ -40,11 +41,15 @@ public: // member functions
QString qwhat() const noexcept; ///< Return the description of the exception as a QString
const char *what() const noexcept override; ///< Return the description of the exception as C style string
QString details() const noexcept; ///< Return the details for the exception
QByteArray attachment() const noexcept; ///< Return the attachment for the exception.
QString detailedWhat() const; ///< Return the detailed description of the message (i.e. including the function name and the details).
private: // data members
QString const qwhat_; ///< The description of the exception.
QByteArray const what_; ///< The c-string version of the qwhat message. Stored as a QByteArray for automatic lifetime management.
QString const details_; ///< The optional details for the exception.
QString const function_; ///< The name of the function that created the exception.
QByteArray const attachment_; ///< The attachment to add to the exception.
};