#include <include/EDoc/exceptions.h>
Inheritance diagram for EDoc::Throwable:

This provides some simple functionality for useful exception objects.
Definition at line 130 of file exceptions.h.
Public Member Functions | |
| Throwable (const char *type_name_in, const char *file_in, int line_in, std::string user_message_in="", std::string dev_message_in="") | |
| Expected to be created in a throw statement. | |
| virtual | ~Throwable () throw () |
| Destructor. | |
| virtual const char * | what () const throw () |
| Return a string of information so that this can be used as a std::exception instance. | |
| std::string | GetType () const |
| Returns the name of the type of exception that was thrown. | |
| std::string | GetFile () const |
| Returns the name of the source file from where the exception was thrown. | |
| int | GetLine () const |
| Returns the line number of the source file from where the exception was thrown. | |
| std::string | GetUserMessage () const |
| Returns the succinct message describing the error for the user. | |
| std::string | GetDevMessage () const |
| Returns the more detailed message describing the error for a developer. | |
Private Attributes | |
| std::string | type_name |
| See GetType(). | |
| std::string | file |
| See GetFile(). | |
| int | line |
| See GetLine(). | |
| std::string | user_message |
| See GetUserMessage(). | |
| std::string | dev_message |
| See GetDevMessage(). | |
| std::string | detailed_message |
| A string that contains all the information for this exception in a single string. | |
| EDoc::Throwable::Throwable | ( | const char * | type_name_in, | |
| const char * | file_in, | |||
| int | line_in, | |||
| std::string | user_message_in = "", |
|||
| std::string | dev_message_in = "" | |||
| ) |
Expected to be created in a throw statement.
This provides a good representation of an error that provides enough information that can be used to help debug problems and also to provide succint useful information to a user when an error occurs.
| type_name_in | This is the name of the exception type being thrown. | |
| file_in | The name of the source file from where the exception is being thrown. | |
| line_in | The line of the source file from where the exception is being thrown. | |
| user_message_in | A string that should be displayed to a user describing succintly the error that occured. | |
| dev_message_in | A more detailed message describing a bit of the state information that may have caused the error to occur. |
Definition at line 26 of file exceptions.cpp.
References detailed_message, dev_message, file, line, and user_message.
| EDoc::Throwable::~Throwable | ( | ) | throw () [inline, virtual] |
| EDoc::Throwable::what | ( | ) | const throw () [virtual] |
Return a string of information so that this can be used as a std::exception instance.
Definition at line 46 of file exceptions.cpp.
References detailed_message.
Referenced by EDoc::Persistence::ReadOpen().
| EDoc::Throwable::GetType | ( | ) | const |
Returns the name of the type of exception that was thrown.
Definition at line 51 of file exceptions.cpp.
References type_name.
| EDoc::Throwable::GetFile | ( | ) | const |
Returns the name of the source file from where the exception was thrown.
Definition at line 56 of file exceptions.cpp.
References file.
| EDoc::Throwable::GetLine | ( | ) | const |
Returns the line number of the source file from where the exception was thrown.
Definition at line 61 of file exceptions.cpp.
References line.
| EDoc::Throwable::GetUserMessage | ( | ) | const |
Returns the succinct message describing the error for the user.
Definition at line 66 of file exceptions.cpp.
References user_message.
| EDoc::Throwable::GetDevMessage | ( | ) | const |
Returns the more detailed message describing the error for a developer.
Definition at line 71 of file exceptions.cpp.
References dev_message.
std::string EDoc::Throwable::type_name [private] |
std::string EDoc::Throwable::file [private] |
See GetFile().
Definition at line 213 of file exceptions.h.
Referenced by GetFile(), and Throwable().
int EDoc::Throwable::line [private] |
See GetLine().
Definition at line 218 of file exceptions.h.
Referenced by GetLine(), and Throwable().
std::string EDoc::Throwable::user_message [private] |
See GetUserMessage().
Definition at line 223 of file exceptions.h.
Referenced by GetUserMessage(), and Throwable().
std::string EDoc::Throwable::dev_message [private] |
See GetDevMessage().
Definition at line 228 of file exceptions.h.
Referenced by GetDevMessage(), and Throwable().
std::string EDoc::Throwable::detailed_message [private] |
A string that contains all the information for this exception in a single string.
This is used by the what() function.
NOTE: It is not a good format to display to the user.
Definition at line 236 of file exceptions.h.
Referenced by Throwable(), and what().
1.5.1