From 465f942baf9c72e4593cba6e1b88ee295d0c19d3 Mon Sep 17 00:00:00 2001 From: Naim A Date: Sun, 31 Jan 2016 04:44:04 +0200 Subject: [PATCH] Added OSError exception class --- src/exceptions.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/exceptions.h b/src/exceptions.h index 43e14b4..589bbdc 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -1,5 +1,6 @@ #pragma once +#include "multiplatform.h" namespace UDPT { @@ -30,4 +31,17 @@ namespace UDPT const char* m_error; const int m_errorCode; }; + + class OSError : public UDPTException + { + public: + OSError(int errorCode +#ifdef WIN32 + = ::GetLastError() +#endif + ) : UDPTException("OSError", errorCode) + { + } + + }; }