API Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Exception.hpp
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Base
28File: Exception
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/BaseValues.h>
35#include <NDEVR/String.h>
36#include <NDEVR/TranslatedString.h>
37#include <exception>
38namespace NDEVR
39{
40
41 class UUID;
42 /**--------------------------------------------------------------------------------------------------
43 \brief Provides consistent interface to handle errors through the throw expression.
44 All exceptions generated by the Parke library inherit from Exception
45 **/
47 {
48 public:
49 virtual ~Exception() = default;
50 NDEVR_BASE_API Exception(const String& title, const bool& capture_stack = true);
51 NDEVR_BASE_API Exception(const TranslatedString& title, const bool& capture_stack = true);
52 NDEVR_BASE_API Exception(const std::exception& exception);
53 NDEVR_BASE_API Exception(const TranslatedString& title, const TranslatedString& message, const bool& capture_stack = true);
54 void setTitle(const TranslatedString& title)
55 {
56 m_title = title;
57 }
58 virtual void setMessage(const TranslatedString& message)
59 {
60 m_message = message;
61 }
62 void setCategory(const TranslatedString& category)
63 {
64 m_category = category;
65 }
66 void setThread(const String& thread)
67 {
69 }
70
72 {
73 return m_message;
74 }
75 virtual const TranslatedString& getTitle() const
76 {
77 return m_title;
78 }
79 virtual const TranslatedString& getCategory() const
80 {
81 return m_category;
82 }
83 virtual const String& stackTrace() const
84 {
85 return m_stack_trace;
86 }
87 virtual uint04 getPriority() const
88 {
89 return m_priority;
90 }
91
92 const String& thread() const
93 {
94 return m_thread;
95 }
98 protected:
105 };
106
107};
108
#define NDEVR_BASE_API
Definition DLLInfo.h:57
Provides consistent interface to handle errors through the throw expression. All exceptions generated...
Definition Exception.hpp:47
virtual uint04 getPriority() const
Definition Exception.hpp:87
TranslatedString m_category
Definition Exception.hpp:101
String m_thread
Definition Exception.hpp:102
virtual ~Exception()=default
String m_stack_trace
Definition Exception.hpp:103
Exception(const TranslatedString &title, const bool &capture_stack=true)
void setThread(const String &thread)
Definition Exception.hpp:66
Exception(const String &title, const bool &capture_stack=true)
virtual const String & stackTrace() const
Definition Exception.hpp:83
void setTitle(const TranslatedString &title)
Definition Exception.hpp:54
virtual const TranslatedString & getCategory() const
Definition Exception.hpp:79
UUID id() const
TranslatedString m_title
Definition Exception.hpp:100
uint04 m_priority
Definition Exception.hpp:104
void setCategory(const TranslatedString &category)
Definition Exception.hpp:62
virtual void setMessage(const TranslatedString &message)
Definition Exception.hpp:58
TranslatedString m_message
Definition Exception.hpp:99
Exception(const TranslatedString &title, const TranslatedString &message, const bool &capture_stack=true)
Exception(const std::exception &exception)
const String & thread() const
Definition Exception.hpp:92
virtual TranslatedString getMessage() const
Definition Exception.hpp:71
virtual const TranslatedString & getTitle() const
Definition Exception.hpp:75
The core String class for the NDEVR API.
Definition String.h:69
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
Definition ACIColor.h:37
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96