|
Mantid
|
The ScriptRepository class is intended to be used mainly by users, who will want to share and download scripts for their analysis. More...
#include <ScriptRepository.h>
Public Member Functions | |
| const std::string & | filePath () const |
| Returns the file and position where the error was caused. | |
| ScriptRepoException (const std::string &info, const std::string &system, const std::string &file=std::string(), int line=-1) | |
| ScriptRepoException (const std::string &info=std::string("Unknown Exception")) | |
| default constructor | |
| const std::string & | systemError () const |
| Returns the error description with technical details on the origin and cause. | |
| const char * | what () const noexcept override |
| Returns the message string. | |
Private Attributes | |
| std::string | m_filepath |
| Path to the file where the error originated, returned by filePath(). | |
| std::string | m_systemError |
| Technical description of the error, returned by systemError(). | |
| std::string | m_userInfo |
| User-facing message, returned by what(). | |
The ScriptRepository class is intended to be used mainly by users, who will want to share and download scripts for their analysis.
As such, the exceptions raised while operating must provide information that is useful for them to understand what is happening, while the Mantid Team must still be informed of what happened in more technical detail in order to be able to deal with any resulting bugs.
To provide this functionality, ScriptRepoException is used. As a normal std::exception (the default base used throughout the Mantid Project), it allows Mantid to work as usual.
It also extends the usage of the exception by allowing more information to be added. Below are some examples of how to throw exceptions.
The default ScriptRepoException::what method is used to show the user message, while it is up to whoever is using the ScriptRepository to decide whether to use the technical information available through ScriptRepoException::systemError and ScriptRepoException::filePath.
Definition at line 94 of file ScriptRepository.h.
|
inline |
default constructor
Definition at line 98 of file ScriptRepository.h.
| Mantid::API::ScriptRepoException::ScriptRepoException | ( | const std::string & | info, |
| const std::string & | system, | ||
| const std::string & | file = std::string(), |
||
| int | line = -1 |
||
| ) |
Definition at line 11 of file ScriptRepository.cpp.
References m_filepath, and std::to_string().
|
inline |
Returns the file and position where the error was caused.
Definition at line 111 of file ScriptRepository.h.
|
inline |
Returns the error description with technical details on the origin and cause.
Definition at line 109 of file ScriptRepository.h.
Referenced by MantidQt::API::RepoModel::handleExceptions(), and MantidQt::API::ScriptRepositoryView::ScriptRepositoryView().
|
overridenoexcept |
Returns the message string.
Definition at line 25 of file ScriptRepository.cpp.
References m_userInfo.
Referenced by download_thread(), MantidQt::API::RepoModel::handleExceptions(), and MantidQt::API::ScriptRepositoryView::ScriptRepositoryView().
|
private |
Path to the file where the error originated, returned by filePath().
Definition at line 119 of file ScriptRepository.h.
Referenced by ScriptRepoException().
|
private |
Technical description of the error, returned by systemError().
Definition at line 115 of file ScriptRepository.h.
|
private |
User-facing message, returned by what().
Definition at line 117 of file ScriptRepository.h.
Referenced by what().