@@ -148,10 +148,11 @@ */ @interface OFOpenFileFailedException: OFException { char *path; char *mode; + int err; } /** * \param obj The object which caused the exception * \param path A C string of the path to the file tried to open @@ -179,10 +180,15 @@ /** * \return An error message for the exception as a C String */ - (const char*)cString; +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + /** * \return A C string of the path to the file which couldn't be opened */ - (char*)path; @@ -197,11 +203,12 @@ */ @interface OFReadOrWriteFailedException: OFException { size_t req_size; size_t req_items; - BOOL has_items; + BOOL has_items; + int err; } /** * \param obj The object which caused the exception * \param size The requested size of the data that couldn't be read / written @@ -240,10 +247,15 @@ * \return A new open file failed exception */ - initWithObject: (id)obj andSize: (size_t)size; +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + /** * \return The requested size of the data that couldn't be read / written */ - (size_t)requestedSize; @@ -324,10 +336,11 @@ */ @interface OFAddressTranslationFailedException: OFException { char *node; char *service; + int err; } /** * \param obj The object which caused the exception * \param node The node for which translation was requested @@ -355,10 +368,15 @@ /** * \return An error message for the exception as a C string. */ - (const char*)cString; +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + /** * /return The node for which translation was requested */ - (const char*)node; @@ -371,12 +389,13 @@ /** * An OFException indicating that the connection could not be established. */ @interface OFConnectionFailedException: OFException { - char *host; + char *host; uint16_t port; + int err; } /** * \param obj The object which caused the exception * \param host The host to which the connection failed @@ -404,10 +423,15 @@ /** * \return An error message for the exception as a C string. */ - (const char*)cString; +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + /** * \return The host to which the connection failed */ - (const char*)host; @@ -420,13 +444,14 @@ /** * An OFException indicating that binding the socket failed. */ @interface OFBindFailedException: OFException { - char *host; + char *host; uint16_t port; - int family; + int family; + int err; } /** * \param obj The object which caused the exception * \param host The host on which binding failed @@ -458,10 +483,15 @@ /** * \return An error message for the exception as a C string. */ - (const char*)cString; +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + /** * \return The host on which binding failed */ - (const char*)host; @@ -480,10 +510,11 @@ * An OFException indicating that listening on the socket failed. */ @interface OFListenFailedException: OFException { int backlog; + int err; } /** * \param obj The object which caused the exception * \param backlog The requested size of the back log @@ -505,20 +536,42 @@ /** * \return An error message for the exception as a C string. */ - (const char*)cString; +/** + * \return The errno from when the exception was created + */ +- (int)errNo; + /** * \return The requested back log. */ - (int)backLog; @end /** * An OFException indicating that accepting a connection failed. */ -@interface OFAcceptFailedException: OFException {} +@interface OFAcceptFailedException: OFException +{ + int err; +} + +/** + * Initializes an already allocated accept failed exception. + * + * \param obj The object which caused the exception + * \return An initialized accept failed exception + */ +- initWithObject: (id)obj; + /** * \return An error message for the exception as a C string. */ - (const char*)cString; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; @end