|
Mantid
|
ErrorReporter : The error reporter is responsible for sending error reports. More...
#include <ErrorReporter.h>
Public Member Functions | |
| ErrorReporter (const std::string &application, const Types::Core::time_duration &startTime, const std::string &exitCode, bool share) | |
| Constructor. More... | |
| ErrorReporter (const std::string &application, const Types::Core::time_duration &startTime, const std::string &exitCode, bool share, const std::string &name, const std::string &email, const std::string &textBox) | |
| Constructor. More... | |
| ErrorReporter (std::string application, Types::Core::time_duration startTime, std::string exitCode, bool share, std::string name, std::string email, std::string textBox, std::string stacktrace) | |
| Constructor. More... | |
| virtual std::string | generateErrorMessage () const |
| Generates an error string in json format. More... | |
| Kernel::InternetHelper::HTTPStatus | sendErrorReport () |
| Sends an error report. More... | |
Protected Member Functions | |
| virtual Kernel::InternetHelper::HTTPStatus | sendReport (const std::string &message, const std::string &url) |
| Sends report using Internet Helper. More... | |
Private Attributes | |
| const std::string | m_application |
| const std::string | m_email |
| const std::string | m_exitCode |
| const std::string | m_name |
| const bool | m_share |
| const std::string | m_stacktrace |
| const std::string | m_textbox |
| const Types::Core::time_duration | m_upTime |
| std::string | m_url |
ErrorReporter : The error reporter is responsible for sending error reports.
Definition at line 22 of file ErrorReporter.h.
| Mantid::Kernel::ErrorReporter::ErrorReporter | ( | const std::string & | application, |
| const Types::Core::time_duration & | startTime, | ||
| const std::string & | exitCode, | ||
| bool | share | ||
| ) |
Constructor.
Definition at line 34 of file ErrorReporter.cpp.
| Mantid::Kernel::ErrorReporter::ErrorReporter | ( | const std::string & | application, |
| const Types::Core::time_duration & | startTime, | ||
| const std::string & | exitCode, | ||
| bool | share, | ||
| const std::string & | name, | ||
| const std::string & | email, | ||
| const std::string & | textBox | ||
| ) |
Constructor.
Definition at line 40 of file ErrorReporter.cpp.
| Mantid::Kernel::ErrorReporter::ErrorReporter | ( | std::string | application, |
| Types::Core::time_duration | startTime, | ||
| std::string | exitCode, | ||
| bool | share, | ||
| std::string | name, | ||
| std::string | email, | ||
| std::string | textBox, | ||
| std::string | stacktrace | ||
| ) |
Constructor.
Definition at line 45 of file ErrorReporter.cpp.
References Mantid::Kernel::Logger::debug(), Mantid::Kernel::DateAndTimeHelpers::g_log, Mantid::Kernel::SingletonHolder< T >::Instance(), and m_url.
|
virtual |
Generates an error string in json format.
Generates an error message in json format.
Definition at line 80 of file ErrorReporter.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), m_application, m_email, m_exitCode, m_name, m_share, m_stacktrace, m_textbox, m_upTime, Mantid::Kernel::ChecksumHelper::md5FromString(), Mantid::Kernel::MantidVersion::revisionFull(), and Mantid::Kernel::MantidVersion::version().
Referenced by export_ErrorReporter(), and sendErrorReport().
| Mantid::Kernel::InternetHelper::HTTPStatus Mantid::Kernel::ErrorReporter::sendErrorReport | ( | ) |
Sends an error report.
Generates an error message and then calls an internet helper to send it.
Definition at line 61 of file ErrorReporter.cpp.
References Mantid::Kernel::InternetHelper::BAD_REQUEST, Mantid::Kernel::Logger::debug(), Mantid::Kernel::Exception::InternetError::errorCode(), Mantid::Kernel::DateAndTimeHelpers::g_log, generateErrorMessage(), m_url, sendReport(), and Mantid::Kernel::Exception::InternetError::what().
Referenced by export_ErrorReporter().
|
protectedvirtual |
Sends report using Internet Helper.
Submits a post request to the specified url with the message as the body.
| message | : String containg json formatted error message |
| url | : The url to send the post request to |
Definition at line 130 of file ErrorReporter.cpp.
References Mantid::Kernel::Exception::InternetError::errorCode(), Mantid::Kernel::DateAndTimeHelpers::g_log, Mantid::Kernel::Logger::information(), Mantid::Kernel::InternetHelper::sendRequest(), Mantid::Kernel::InternetHelper::setBody(), Mantid::Kernel::InternetHelper::setTimeout(), and Mantid::Kernel::Exception::InternetError::what().
Referenced by sendErrorReport().
|
private |
Definition at line 44 of file ErrorReporter.h.
Referenced by generateErrorMessage().
|
private |
Definition at line 49 of file ErrorReporter.h.
Referenced by generateErrorMessage().
|
private |
Definition at line 45 of file ErrorReporter.h.
Referenced by generateErrorMessage().
|
private |
Definition at line 48 of file ErrorReporter.h.
Referenced by generateErrorMessage().
|
private |
Definition at line 47 of file ErrorReporter.h.
Referenced by generateErrorMessage().
|
private |
Definition at line 52 of file ErrorReporter.h.
Referenced by generateErrorMessage().
|
private |
Definition at line 50 of file ErrorReporter.h.
Referenced by generateErrorMessage().
|
private |
Definition at line 46 of file ErrorReporter.h.
Referenced by generateErrorMessage().
|
private |
Definition at line 51 of file ErrorReporter.h.
Referenced by ErrorReporter(), and sendErrorReport().