@@ -25,19 +25,25 @@ * * @brief An exception indicating an item could not be opened. */ @interface OFOpenItemFailedException: OFException { - OFURL *_URL; - OFString *_Nullable _mode; + OFURL *_Nullable _URL; + OFString *_Nullable _path; + OFString *_mode; int _errNo; } /** * @brief The URL of the item which could not be opened. */ -@property (readonly, nonatomic) OFURL *URL; +@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFURL *URL; + +/** + * @brief The path of the item which could not be opened. + */ +@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *path; /** * @brief The mode in which the item should have been opened. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *mode; @@ -57,10 +63,22 @@ */ + (instancetype)exceptionWithURL: (OFURL *)URL mode: (nullable OFString *)mode errNo: (int)errNo; +/** + * @brief Creates a new, autoreleased open item failed exception. + * + * @param path The path of the item which could not be opened + * @param mode A string with the mode in which the item should have been opened + * @param errNo The errno of the error that occurred + * @return A new, autoreleased open item failed exception + */ ++ (instancetype)exceptionWithPath: (OFString *)path + mode: (nullable OFString *)mode + errNo: (int)errNo; + + (instancetype)exception OF_UNAVAILABLE; /** * @brief Initializes an already allocated open item failed exception. * @@ -71,9 +89,21 @@ */ - (instancetype)initWithURL: (OFURL *)URL mode: (nullable OFString *)mode errNo: (int)errNo; +/** + * @brief Initializes an already allocated open item failed exception. + * + * @param path The path of the item which could not be opened + * @param mode A string with the mode in which the item should have been opened + * @param errNo The errno of the error that occurred + * @return An initialized open item failed exception + */ +- (instancetype)initWithPath: (OFString *)path + mode: (nullable OFString *)mode + errNo: (int)errNo; + - (instancetype)init OF_UNAVAILABLE; @end OF_ASSUME_NONNULL_END