Index: src/OFString+Serialization.h ================================================================== --- src/OFString+Serialization.h +++ src/OFString+Serialization.h @@ -26,10 +26,17 @@ #endif @interface OFString (Serialization) /** * @brief The string interpreted as serialization and parsed as an object. + * + * @throw OFMalformedXMLException The XML was malformed + * @throw OFUnboundNamespaceException A prefix was used that was not bound to + * any namespace + * @throw OFInvalidEncodingException The XML is not in the encoding it specified + * @throw OFUnsupportedVersionException The serialization is in an unsupported + * version */ @property (readonly, nonatomic) id objectByDeserializing; @end OF_ASSUME_NONNULL_END Index: src/OFString+Serialization.m ================================================================== --- src/OFString+Serialization.m +++ src/OFString+Serialization.m @@ -36,17 +36,11 @@ OFXMLElement *root; OFString *version; OFArray *elements; id object; - @try { - root = [OFXMLElement elementWithXMLString: self]; - } @catch (OFMalformedXMLException *e) { - @throw [OFInvalidArgumentException exception]; - } @catch (OFUnboundNamespaceException *e) { - @throw [OFInvalidArgumentException exception]; - } + root = [OFXMLElement elementWithXMLString: self]; version = [root attributeForName: @"version"].stringValue; if (version == nil) @throw [OFInvalidArgumentException exception]; Index: src/OFSubprocess.h ================================================================== --- src/OFSubprocess.h +++ src/OFSubprocess.h @@ -192,18 +192,23 @@ * @brief Closes the write direction of the subprocess. * * This method needs to be called for some programs before data can be read, * since some programs don't start processing before the write direction is * closed. + * + * @throw OFNotOpenException The subprocess was already closed */ - (void)closeForWriting; /** * @brief Waits for the subprocess to terminate and returns the exit status. * * If the subprocess has already exited, this returns the exit status * immediately. + * + * @return The status code of the subprocess + * @throw OFNotOpenException The subprocess was already closed */ - (int)waitForTermination; @end OF_ASSUME_NONNULL_END Index: src/OFTLSStream.h ================================================================== --- src/OFTLSStream.h +++ src/OFTLSStream.h @@ -126,28 +126,33 @@ /** * @brief Asynchronously performs the TLS client handshake for the specified * host and calls the delegate afterwards. * * @param host The host to perform the handshake with + * @throw OFTLSHandshakeFailedException The TLS handshake failed + * @throw OFAlreadyConnectedException The handshake was already performed */ - (void)asyncPerformClientHandshakeWithHost: (OFString *)host; /** * @brief Asynchronously performs the TLS client handshake for the specified * host and calls the delegate afterwards. * * @param host The host to perform the handshake with * @param runLoopMode The run loop mode in which to perform the async handshake + * @throw OFTLSHandshakeFailedException The TLS handshake failed + * @throw OFAlreadyConnectedException The handshake was already performed */ - (void)asyncPerformClientHandshakeWithHost: (OFString *)host runLoopMode: (OFRunLoopMode)runLoopMode; /** * @brief Performs the TLS client handshake for the specified host. * * @param host The host to perform the handshake with * @throw OFTLSHandshakeFailedException The TLS handshake failed + * @throw OFAlreadyConnectedException The handshake was already performed */ - (void)performClientHandshakeWithHost: (OFString *)host; @end #ifdef __cplusplus Index: src/OFURI.h ================================================================== --- src/OFURI.h +++ src/OFURI.h @@ -199,10 +199,11 @@ * If a directory exists at the specified path, a slash is appended if there is * no slash yet. * * @param path The local file path * @return A new, autoreleased OFURI + * @throw OFInvalidFormatException The specified path is not a valid path */ + (instancetype)fileURIWithPath: (OFString *)path; /** * @brief Creates a new URI with the specified local file path. @@ -246,10 +247,11 @@ * If a directory exists at the specified path, a slash is appended if there is * no slash yet. * * @param path The local file path * @return An initialized OFURI + * @throw OFInvalidFormatException The specified path is not a valid path */ - (instancetype)initFileURIWithPath: (OFString *)path; /** * @brief Initializes an already allocated OFURI with the specified local file Index: src/platform/POSIX/OFSubprocess.m ================================================================== --- src/platform/POSIX/OFSubprocess.m +++ src/platform/POSIX/OFSubprocess.m @@ -361,12 +361,14 @@ return _writePipe[1]; } - (void)closeForWriting { - if (_writePipe[1] != -1) - close(_writePipe[1]); + if (_readPipe[0] == -1 || _writePipe[1] == -1) + @throw [OFNotOpenException exceptionWithObject: self]; + + close(_writePipe[1]); _writePipe[1] = -1; } - (void)close Index: src/platform/Windows/OFSubprocess.m ================================================================== --- src/platform/Windows/OFSubprocess.m +++ src/platform/Windows/OFSubprocess.m @@ -368,12 +368,14 @@ return (size_t)bytesWritten; } - (void)closeForWriting { - if (_writePipe[1] != NULL) - CloseHandle(_writePipe[1]); + if (_readPipe[0] == NULL || _writePipe[1] == NULL) + @throw [OFNotOpenException exceptionWithObject: self]; + + CloseHandle(_writePipe[1]); _writePipe[1] = NULL; } - (void)close