diff options
Diffstat (limited to 'client/err.hpp')
| -rw-r--r-- | client/err.hpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/client/err.hpp b/client/err.hpp new file mode 100644 index 0000000..5a6691d --- /dev/null +++ b/client/err.hpp @@ -0,0 +1,22 @@ +#pragma once
+#include "strings.hpp"
+
+namespace err
+{
+ enum ErrCode_t {
+ ERR_NONE = 0,
+ ERR_WSA = 1,
+ ERR_CONNECT = 2,
+ };
+
+ const char* translate_err( int code ) {
+ switch( code ) {
+ case ERR_WSA:
+ return xors( "socket error" );
+ case ERR_CONNECT:
+ return xors( "connection error" );
+ }
+
+ return xors( "unknown error" );
+ }
+}
\ No newline at end of file |
