summaryrefslogtreecommitdiff
path: root/src/shared/windows_error.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/windows_error.h')
-rw-r--r--src/shared/windows_error.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/shared/windows_error.h b/src/shared/windows_error.h
index ea506dc1..2bdd6392 100644
--- a/src/shared/windows_error.h
+++ b/src/shared/windows_error.h
@@ -20,25 +20,28 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#ifndef WINDOWS_ERROR_H
#define WINDOWS_ERROR_H
-
#include <stdexcept>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-namespace MOShared {
+namespace MOShared
+{
-class windows_error : public std::runtime_error {
+class windows_error : public std::runtime_error
+{
public:
windows_error(const std::string& message, int errorcode = ::GetLastError())
- : runtime_error(constructMessage(message, errorcode)), m_ErrorCode(errorcode)
+ : runtime_error(constructMessage(message, errorcode)), m_ErrorCode(errorcode)
{}
int getErrorCode() const { return m_ErrorCode; }
+
private:
std::string constructMessage(const std::string& input, int errorcode);
+
private:
int m_ErrorCode;
};
-} // namespace MOShared
+} // namespace MOShared
-#endif // WINDOWS_ERROR_H
+#endif // WINDOWS_ERROR_H