Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Mantid::Kernel::ErrorReporter Class Reference

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
 

Detailed Description

ErrorReporter : The error reporter is responsible for sending error reports.

Definition at line 22 of file ErrorReporter.h.

Constructor & Destructor Documentation

◆ ErrorReporter() [1/3]

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.

◆ ErrorReporter() [2/3]

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.

◆ ErrorReporter() [3/3]

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 
)

Member Function Documentation

◆ generateErrorMessage()

std::string Mantid::Kernel::ErrorReporter::generateErrorMessage ( ) const
virtual

◆ sendErrorReport()

Mantid::Kernel::InternetHelper::HTTPStatus Mantid::Kernel::ErrorReporter::sendErrorReport ( )

◆ sendReport()

Kernel::InternetHelper::HTTPStatus Mantid::Kernel::ErrorReporter::sendReport ( const std::string &  message,
const std::string &  url 
)
protectedvirtual

Sends report using Internet Helper.

Submits a post request to the specified url with the message as the body.

Parameters
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().

Member Data Documentation

◆ m_application

const std::string Mantid::Kernel::ErrorReporter::m_application
private

Definition at line 44 of file ErrorReporter.h.

Referenced by generateErrorMessage().

◆ m_email

const std::string Mantid::Kernel::ErrorReporter::m_email
private

Definition at line 49 of file ErrorReporter.h.

Referenced by generateErrorMessage().

◆ m_exitCode

const std::string Mantid::Kernel::ErrorReporter::m_exitCode
private

Definition at line 45 of file ErrorReporter.h.

Referenced by generateErrorMessage().

◆ m_name

const std::string Mantid::Kernel::ErrorReporter::m_name
private

Definition at line 48 of file ErrorReporter.h.

Referenced by generateErrorMessage().

◆ m_share

const bool Mantid::Kernel::ErrorReporter::m_share
private

Definition at line 47 of file ErrorReporter.h.

Referenced by generateErrorMessage().

◆ m_stacktrace

const std::string Mantid::Kernel::ErrorReporter::m_stacktrace
private

Definition at line 52 of file ErrorReporter.h.

Referenced by generateErrorMessage().

◆ m_textbox

const std::string Mantid::Kernel::ErrorReporter::m_textbox
private

Definition at line 50 of file ErrorReporter.h.

Referenced by generateErrorMessage().

◆ m_upTime

const Types::Core::time_duration Mantid::Kernel::ErrorReporter::m_upTime
private

Definition at line 46 of file ErrorReporter.h.

Referenced by generateErrorMessage().

◆ m_url

std::string Mantid::Kernel::ErrorReporter::m_url
private

Definition at line 51 of file ErrorReporter.h.

Referenced by ErrorReporter(), and sendErrorReport().


The documentation for this class was generated from the following files: