aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/qlicenseservice/errors.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/qlicenseservice/errors.h')
-rw-r--r--src/libs/qlicenseservice/errors.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/libs/qlicenseservice/errors.h b/src/libs/qlicenseservice/errors.h
new file mode 100644
index 0000000..fff21dd
--- /dev/null
+++ b/src/libs/qlicenseservice/errors.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 2023 The Qt Company Ltd.
+ *
+ * SPDX-License-Identifier: GPL-3.0-only WITH Qt-GPL-exception-1.0
+*/
+
+#pragma once
+
+#include <stdexcept>
+#include <string>
+
+namespace QLicenseService {
+
+class Error : public std::runtime_error
+{
+public:
+ explicit Error(const char *message)
+ : std::runtime_error(message)
+ {}
+
+ explicit Error(const std::string &message)
+ : std::runtime_error(message)
+ {}
+
+ virtual ~Error() noexcept
+ {}
+
+ virtual const char *what() const noexcept override
+ {
+ return std::runtime_error::what();
+ }
+};
+
+} // namespace QLicenseService