From 7ccb819f867493f8ec202ea3b39c94c198c64584 Mon Sep 17 00:00:00 2001 From: JustSomePwner Date: Thu, 30 Aug 2018 14:01:54 +0200 Subject: first --- client/err.hpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 client/err.hpp (limited to 'client/err.hpp') 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 -- cgit v1.2.3