Throw GAIException() for getaddrinfo errors
Created a new subclass of Exception called GAIException() that will handle error messages from getaddrinfo() instead of letting Exception() handle it. GAIException() will make use of gai_strerror() to map the error code to text. On Windows, gai_strerrorW() must be used if the text is encoded with UTF-8.
This commit is contained in:
committed by
Lauri Kasanen
parent
209712b18f
commit
03639406dc
@@ -40,12 +40,17 @@ namespace rdr {
|
||||
struct SystemException : public Exception {
|
||||
int err;
|
||||
SystemException(const char* s, int err_);
|
||||
};
|
||||
};
|
||||
|
||||
struct GAIException : public Exception {
|
||||
int err;
|
||||
GAIException(const char* s, int err_);
|
||||
};
|
||||
|
||||
struct TimedOut : public Exception {
|
||||
TimedOut() : Exception("Timed out") {}
|
||||
};
|
||||
|
||||
|
||||
struct EndOfStream : public Exception {
|
||||
EndOfStream() : Exception("End of stream") {}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user