ObjFW  Check-in [cc4cb0d824]

Overview
Comment:exceptions: Add nullability specifiers
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: cc4cb0d824244f0dff026c3516cd1739de348479e6c158a6a35ca6453daf1059
User & Date: js on 2017-05-02 21:10:33
Other Links: manifest | tags
Context
2017-05-06
19:25
OFMutableString: Add missing #ifdef check-in: 322bbaf8e9 user: js tags: trunk
2017-05-02
21:10
exceptions: Add nullability specifiers check-in: cc4cb0d824 user: js tags: trunk
2017-05-01
18:48
Add OF_NULL_RESETTABLE_PROPERTY check-in: 3faceccdd3 user: js tags: trunk
Changes

Modified src/OFKernelEventObserver_epoll.m from [73fb41141f] to [7c101cdbc0].

47
48
49
50
51
52
53
54


55
56
57
58
59


60
61
62
63
64
65
66
67
68
69
70
71
72
73
74


75
76
77
78
79
80
81
47
48
49
50
51
52
53

54
55
56
57
58
59

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75

76
77
78
79
80
81
82
83
84







-
+
+




-
+
+














-
+
+







	self = [super init];

	@try {
		struct epoll_event event;

#ifdef HAVE_EPOLL_CREATE1
		if ((_epfd = epoll_create1(EPOLL_CLOEXEC)) == -1)
			@throw [OFInitializationFailedException exception];
			@throw [OFInitializationFailedException
			    exceptionWithClass: [self class]];
#else
		int flags;

		if ((_epfd = epoll_create(1)) == -1)
			@throw [OFInitializationFailedException exception];
			@throw [OFInitializationFailedException
			    exceptionWithClass: [self class]];

		if ((flags = fcntl(_epfd, F_GETFD, 0)) != -1)
			fcntl(_epfd, F_SETFD, flags | FD_CLOEXEC);
#endif

		_FDToEvents = [[OFMapTable alloc]
		    initWithKeyFunctions: mapFunctions
			 objectFunctions: mapFunctions];

		memset(&event, 0, sizeof(event));
		event.events = EPOLLIN;
		event.data.ptr = [OFNull null];

		if (epoll_ctl(_epfd, EPOLL_CTL_ADD, _cancelFD[0], &event) == -1)
			@throw [OFInitializationFailedException exception];
			@throw [OFInitializationFailedException
			    exceptionWithClass: [self class]];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

Modified src/OFKernelEventObserver_select.m from [2e0aa307e5] to [e55d2ae955].

45
46
47
48
49
50
51
52


53
54
55
56
57
58
59
45
46
47
48
49
50
51

52
53
54
55
56
57
58
59
60







-
+
+







@implementation OFKernelEventObserver_select
- init
{
	self = [super init];

#ifndef OF_WINDOWS
	if (_cancelFD[0] >= (int)FD_SETSIZE)
		@throw [OFInitializationFailedException exception];
		@throw [OFInitializationFailedException
		    exceptionWithClass: [self class]];
#endif

	FD_ZERO(&_readFDs);
	FD_ZERO(&_writeFDs);
	FD_SET(_cancelFD[0], &_readFDs);

	if (_cancelFD[0] > INT_MAX)

Modified src/OFString.m from [99b26a69a8] to [fd629bc278].

586
587
588
589
590
591
592
593


594
595
596
597
598
599
600
586
587
588
589
590
591
592

593
594
595
596
597
598
599
600
601







-
+
+







	if (self != [OFString class])
		return;

	placeholder.isa = [OFString_placeholder class];

#if defined(HAVE_STRTOF_L) || defined(HAVE_STRTOD_L)
	if ((cLocale = newlocale(LC_ALL_MASK, "C", NULL)) == NULL)
		@throw [OFInitializationFailedException exception];
		@throw [OFInitializationFailedException
		    exceptionWithClass: self];
#endif
}

+ alloc
{
	if (self == [OFString class])
		return (id)&placeholder;

Modified src/exceptions/OFAcceptFailedException.h from [d7a51572db] to [8d1f9458f7].

16
17
18
19
20
21
22


23
24
25
26
27
28
29
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31







+
+








#import "OFException.h"

#ifndef OF_HAVE_SOCKETS
# error No sockets available!
#endif

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFAcceptFailedException \
 *	  OFAcceptFailedException.h ObjFW/OFAcceptFailedException.h
 *
 * @brief An exception indicating that accepting a connection failed.
 */
@interface OFAcceptFailedException: OFException
58
59
60
61
62
63
64


60
61
62
63
64
65
66
67
68







+
+
 * @param socket The socket which could not accept a connection
 * @param errNo The errno for the error
 * @return An initialized accept failed exception
 */
- initWithSocket: (id)socket
	   errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFAddressTranslationFailedException.h from [1e0f5699bd] to [2e4d1739ad].

16
17
18
19
20
21
22


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

40
41
42
43
44
45
46
47

48
49

50
51
52
53
54
55
56
57
58
59

60
61

62
63
64


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

41
42
43
44
45
46
47
48

49
50

51
52
53
54
55
56
57
58
59
60

61
62

63
64
65
66
67
68







+
+
















-
+







-
+

-
+









-
+

-
+



+
+

#import "OFException.h"

#ifndef OF_HAVE_SOCKETS
# error No sockets available!
#endif

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFAddressTranslationFailedException \
 *	  OFAddressTranslationFailedException.h \
 *	  ObjFW/OFAddressTranslationFailedException.h
 *
 * @brief An exception indicating the translation of an address failed.
 */
@interface OFAddressTranslationFailedException: OFException
{
	OFString *_host;
	int _error;
}

/*!
 * The host for which the address translation was requested.
 */
@property (readonly, nonatomic) OFString *host;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *host;

/*!
 * @brief Creates a new, autoreleased address translation failed exception.
 *
 * @param host The host for which translation was requested
 * @return A new, autoreleased address translation failed exception
 */
+ (instancetype)exceptionWithHost: (OFString*)host;
+ (instancetype)exceptionWithHost: (nullable OFString*)host;

+ (instancetype)exceptionWithHost: (OFString*)host
+ (instancetype)exceptionWithHost: (nullable OFString*)host
			    error: (int)error;
+ (instancetype)exceptionWithError: (int)error;

/*!
 * @brief Initializes an already allocated address translation failed exception.
 *
 * @param host The host for which translation was requested
 * @return An initialized address translation failed exception
 */
- initWithHost: (OFString*)host;
- initWithHost: (nullable OFString*)host;

- (instancetype)initWithHost: (OFString*)host
- (instancetype)initWithHost: (nullable OFString*)host
		       error: (int)error;
- (instancetype)initWithError: (int)error;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFAddressTranslationFailedException.m from [60ff6a024f] to [eb706ff06f].

37
38
39
40
41
42
43
44


45
46
47
48
49
50
51
37
38
39
40
41
42
43

44
45
46
47
48
49
50
51
52







-
+
+







#if !defined(HAVE_THREADSAFE_GETADDRINFO) && defined(OF_HAVE_THREADS)
+ (void)initialize
{
	if (self != [OFAddressTranslationFailedException class])
		return;

	if (!of_mutex_new(&mutex))
		@throw [OFInitializationFailedException exception];
		@throw [OFInitializationFailedException
		    exceptionWithClass: class];
}
#endif

+ (instancetype)exceptionWithHost: (OFString*)host
{
	return [[[self alloc] initWithHost: host] autorelease];
}

Modified src/exceptions/OFAllocFailedException.h from [49be1d26b2] to [4100b2fe9e].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;

/*!
 * @class OFAllocFailedException \
 *	  OFAllocFailedException.h ObjFW/OFAllocFailedException.h
 *
 * @brief An exception indicating an object could not be allocated.
37
38
39
40
41
42
43


39
40
41
42
43
44
45
46
47







+
+
/*!
 * @brief Returns a description of the exception.
 *
 * @return A description of the exception
 */
- (OFString*)description;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFAlreadyConnectedException.h from [d29f44b8a3] to [394c47d4b8].

16
17
18
19
20
21
22


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

39
40
41
42
43
44
45
46

47
48
49
50
51
52
53
54

55


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

40
41
42
43
44
45
46
47

48
49
50
51
52
53
54
55

56
57
58
59







+
+















-
+







-
+







-
+

+
+

#import "OFException.h"

#ifndef OF_HAVE_SOCKETS
# error No sockets available!
#endif

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFAlreadyConnectedException \
 *	  OFAlreadyConnectedException.h ObjFW/OFAlreadyConnectedException.h
 *
 * @brief An exception indicating an attempt to connect or bind an already
 *        connected or bound socket.
 */
@interface OFAlreadyConnectedException: OFException
{
	id _socket;
}

/*!
 * The socket which is already connected.
 */
@property (readonly, nonatomic) id socket;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) id socket;

/*!
 * @brief Creates a new, autoreleased already connected exception.
 *
 * @param socket The socket which is already connected
 * @return A new, autoreleased already connected exception
 */
+ (instancetype)exceptionWithSocket: (id)socket;
+ (instancetype)exceptionWithSocket: (nullable id)socket;

/*!
 * @brief Initializes an already allocated already connected exception.
 *
 * @param socket The socket which is already connected
 * @return An initialized already connected exception
 */
- initWithSocket: (id)socket;
- initWithSocket: (nullable id)socket;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFBindFailedException.h from [8704ec525d] to [c2c0f94e68].

16
17
18
19
20
21
22


23
24
25
26
27
28
29
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31







+
+








#import "OFException.h"

#ifndef OF_HAVE_SOCKETS
# error No sockets available!
#endif

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFBindFailedException \
 *	  OFBindFailedException.h ObjFW/OFBindFailedException.h
 *
 * @brief An exception indicating that binding a socket failed.
 */
@interface OFBindFailedException: OFException
78
79
80
81
82
83
84


80
81
82
83
84
85
86
87
88







+
+
 * @return An initialized bind failed exception
 */
- initWithHost: (OFString*)host
	  port: (uint16_t)port
	socket: (id)socket
	 errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFChangeCurrentDirectoryPathFailedException.h from [db18cd1da4] to [93572132e5].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFChangeCurrentDirectoryPathFailedException \
 *	  OFChangeCurrentDirectoryPathFailedException.h \
 *	  ObjFW/OFChangeCurrentDirectoryPathFailedException.h
 *
 * @brief An exception indicating that changing the current directory path
 *	  failed.
59
60
61
62
63
64
65


61
62
63
64
65
66
67
68
69







+
+
 *	       changed
 * @param errNo The errno of the error that occurred
 * @return An initialized change current directory path failed exception
 */
- initWithPath: (OFString*)path
	 errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFChangeOwnerFailedException.h from [3ef254830f] to [b287da5fe9].

12
13
14
15
16
17
18

19

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

41
42
43
44
45

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63


64
65
66
67
68
69
70
71
72
73
74
75
76
77


78
79
80


12
13
14
15
16
17
18
19

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

41
42
43
44
45

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62


63
64
65
66
67
68
69
70
71
72
73
74
75
76


77
78
79
80

81
82







+
-
+




















-
+




-
+
















-
-
+
+












-
-
+
+


-
+
+
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN
#ifdef OF_HAVE_CHOWN

/*!
 * @class OFChangeOwnerFailedException \
 *	  OFChangeOwnerFailedException.h ObjFW/OFChangeOwnerFailedException.h
 *
 * @brief An exception indicating that changing the owner of an item failed.
 */
@interface OFChangeOwnerFailedException: OFException
{
	OFString *_path, *_owner, *_group;
	int _errNo;
}

/*!
 * The path of the item.
 */
@property (readonly, nonatomic) OFString *path;

/*!
 * The new owner for the item.
 */
@property (readonly, nonatomic) OFString *owner;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *owner;

/*!
 * The new group for the item.
 */
@property (readonly, nonatomic) OFString *group;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *group;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;

/*!
 * @brief Creates a new, autoreleased change owner failed exception.
 *
 * @param path The path of the item
 * @param owner The new owner for the item
 * @param group The new group for the item
 * @param errNo The errno of the error that occurred
 * @return A new, autoreleased change owner failed exception
 */
+ (instancetype)exceptionWithPath: (OFString*)path
			    owner: (OFString*)owner
			    group: (OFString*)group
			    owner: (nullable OFString*)owner
			    group: (nullable OFString*)group
			    errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated change owner failed exception.
 *
 * @param path The path of the item
 * @param owner The new owner for the item
 * @param group The new group for the item
 * @param errNo The errno of the error that occurred
 * @return An initialized change owner failed exception
 */
- initWithPath: (OFString*)path
	 owner: (OFString*)owner
	 group: (OFString*)group
	 owner: (nullable OFString*)owner
	 group: (nullable OFString*)group
	 errNo: (int)errNo;
@end
#endif

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFChangeOwnerFailedException.m from [14448a4792] to [c1acdcd0f7].

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
15
16
17
18
19
20
21

22
23
24
25
26
27
28







-







 */

#include "config.h"

#import "OFChangeOwnerFailedException.h"
#import "OFString.h"

#ifdef OF_HAVE_CHOWN
@implementation OFChangeOwnerFailedException
@synthesize path = _path, owner = _owner, group = _group, errNo = _errNo;

+ (instancetype)exceptionWithPath: (OFString*)path
			    owner: (OFString*)owner
			    group: (OFString*)group
			    errNo: (int)errNo
80
81
82
83
84
85
86
87
79
80
81
82
83
84
85








-
		     _path, _group, of_strerror(_errNo)];
	else
		return [OFString stringWithFormat:
		    @"Failed to change owner of item at path %@ to %@:%@: %@",
		    _path, _owner, _group, of_strerror(_errNo)];
}
@end
#endif

Modified src/exceptions/OFChangePermissionsFailedException.h from [bc22d5d3ad] to [0f5d5d06cd].

14
15
16
17
18
19
20


21
22
23
24
25
26
27
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29







+
+







 * file.
 */

#include <sys/types.h>

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFChangePermissionsFailedException \
 *	  OFChangePermissionsFailedException.h \
 *	  ObjFW/OFChangePermissionsFailedException.h
 *
 * @brief An exception indicating that changing the permissions of an item
 *	  failed.
68
69
70
71
72
73
74


70
71
72
73
74
75
76
77
78







+
+
 * @param errNo The errno of the error that occurred
 * @return An initialized change permissions failed exception
 */
- initWithPath: (OFString*)path
   permissions: (mode_t)permissions
	 errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFChecksumFailedException.h from [020d23644b] to [89aff9d8e9].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30







+
+








+
+
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFChecksumFailedException \
 *	  OFChecksumFailedException.h ObjFW/OFChecksumFailedException.h
 *
 * @brief An exception indicating that a checksum did not match.
 */
@interface OFChecksumFailedException: OFException
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFConditionBroadcastFailedException.h from [30d4c356dc] to [437194a4ea].

16
17
18
19
20
21
22


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

41
42
43
44
45
46
47
48

49
50
51
52
53
54
55
56

57


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

42
43
44
45
46
47
48
49

50
51
52
53
54
55
56
57

58
59
60
61







+
+

















-
+







-
+







-
+

+
+

#import "OFException.h"

#ifndef OF_HAVE_THREADS
# error No threads available!
#endif

OF_ASSUME_NONNULL_BEGIN

@class OFCondition;

/*!
 * @class OFConditionBroadcastFailedException \
 *	  OFConditionBroadcastFailedException.h \
 *	  ObjFW/OFConditionBroadcastFailedException.h
 *
 * @brief An exception indicating broadcasting a condition failed.
 */
@interface OFConditionBroadcastFailedException: OFException
{
	OFCondition *_condition;
}

/*!
 * The condition which could not be broadcasted.
 */
@property (readonly, nonatomic) OFCondition *condition;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFCondition *condition;

/*!
 * @brief Returns a new, autoreleased condition broadcast failed exception.
 *
 * @param condition The condition which could not be broadcasted
 * @return A new, autoreleased condition broadcast failed exception
 */
+ (instancetype)exceptionWithCondition: (OFCondition*)condition;
+ (instancetype)exceptionWithCondition: (nullable OFCondition*)condition;

/*!
 * @brief Initializes an already allocated condition broadcast failed exception.
 *
 * @param condition The condition which could not be broadcasted
 * @return An initialized condition broadcast failed exception
 */
- initWithCondition: (OFCondition*)condition;
- initWithCondition: (nullable OFCondition*)condition;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFConditionBroadcastFailedException.m from [e9d105b601] to [025e3341b0].

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

54
55





56
57
24
25
26
27
28
29
30





31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49


50
51
52
53
54
55
56







-
-
-
-
-


















+
-
-
+
+
+
+
+


@synthesize condition = _condition;

+ (instancetype)exceptionWithCondition: (OFCondition*)condition
{
	return [[[self alloc] initWithCondition: condition] autorelease];
}

- init
{
	OF_INVALID_INIT_METHOD
}

- initWithCondition: (OFCondition*)condition
{
	self = [super init];

	_condition = [condition retain];

	return self;
}

- (void)dealloc
{
	[_condition release];

	[super dealloc];
}

- (OFString*)description
{
	if (_condition != nil)
	return [OFString stringWithFormat:
	    @"Broadcasting a condition of type %@ failed!", [_condition class]];
		return [OFString stringWithFormat:
		    @"Broadcasting a condition of type %@ failed!",
		    [_condition class]];
	else
		return @"Broadcasting a condition failed!";
}
@end

Modified src/exceptions/OFConditionSignalFailedException.h from [08f88058e2] to [39b1e11cca].

16
17
18
19
20
21
22


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

41
42
43
44
45
46
47
48

49
50
51
52
53
54
55
56

57


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

42
43
44
45
46
47
48
49

50
51
52
53
54
55
56
57

58
59
60
61







+
+

















-
+







-
+







-
+

+
+

#import "OFException.h"

#ifndef OF_HAVE_THREADS
# error No threads available!
#endif

OF_ASSUME_NONNULL_BEGIN

@class OFCondition;

/*!
 * @class OFConditionSignalFailedException \
 *	  OFConditionSignalFailedException.h \
 *	  ObjFW/OFConditionSignalFailedException.h
 *
 * @brief An exception indicating signaling a condition failed.
 */
@interface OFConditionSignalFailedException: OFException
{
	OFCondition *_condition;
}

/*!
 * The condition which could not be signaled.
 */
@property (readonly, nonatomic) OFCondition *condition;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFCondition *condition;

/*!
 * @brief Creates a new, autoreleased condition signal failed exception.
 *
 * @param condition The condition which could not be signaled
 * @return A new, autoreleased condition signal failed exception
 */
+ (instancetype)exceptionWithCondition: (OFCondition*)condition;
+ (instancetype)exceptionWithCondition: (nullable OFCondition*)condition;

/*!
 * @brief Initializes an already allocated condition signal failed exception.
 *
 * @param condition The condition which could not be signaled
 * @return An initialized condition signal failed exception
 */
- initWithCondition: (OFCondition*)condition;
- initWithCondition: (nullable OFCondition*)condition;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFConditionSignalFailedException.m from [18903fe598] to [ed61ab5b51].

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

54
55





56
57
24
25
26
27
28
29
30





31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49


50
51
52
53
54
55
56







-
-
-
-
-


















+
-
-
+
+
+
+
+


@synthesize condition = _condition;

+ (instancetype)exceptionWithCondition: (OFCondition*)condition
{
	return [[[self alloc] initWithCondition: condition] autorelease];
}

- init
{
	OF_INVALID_INIT_METHOD
}

- initWithCondition: (OFCondition*)condition
{
	self = [super init];

	_condition = [condition retain];

	return self;
}

- (void)dealloc
{
	[_condition release];

	[super dealloc];
}

- (OFString*)description
{
	if (_condition != nil)
	return [OFString stringWithFormat:
	    @"Signaling a condition of type %@ failed!", [_condition class]];
		return [OFString stringWithFormat:
		    @"Signaling a condition of type %@ failed!",
		    [_condition class]];
	else
		return @"Signaling a condition failed!";
}
@end

Modified src/exceptions/OFConditionStillWaitingException.h from [edaf7a58ce] to [3b236e57e8].

16
17
18
19
20
21
22


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

42
43
44
45
46
47
48
49

50
51
52
53
54
55
56
57

58


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

43
44
45
46
47
48
49
50

51
52
53
54
55
56
57
58

59
60
61
62







+
+


















-
+







-
+







-
+

+
+

#import "OFException.h"

#ifndef OF_HAVE_THREADS
# error No threads available!
#endif

OF_ASSUME_NONNULL_BEGIN

@class OFCondition;

/*!
 * @class OFConditionStillWaitingException \
 *	  OFConditionStillWaitingException.h \
 *	  ObjFW/OFConditionStillWaitingException.h
 *
 * @brief An exception indicating that a thread is still waiting for a
 *	  condition.
 */
@interface OFConditionStillWaitingException: OFException
{
	OFCondition *_condition;
}

/*!
 * The condition for which is still being waited.
 */
@property (readonly, nonatomic) OFCondition *condition;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFCondition *condition;

/*!
 * @brief Creates a new, autoreleased condition still waiting exception.
 *
 * @param condition The condition for which is still being waited
 * @return A new, autoreleased condition still waiting exception
 */
+ (instancetype)exceptionWithCondition: (OFCondition*)condition;
+ (instancetype)exceptionWithCondition: (nullable OFCondition*)condition;

/*!
 * @brief Initializes an already allocated condition still waiting exception.
 *
 * @param condition The condition for which is still being waited
 * @return An initialized condition still waiting exception
 */
- initWithCondition: (OFCondition*)condition;
- initWithCondition: (nullable OFCondition*)condition;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFConditionStillWaitingException.m from [9ae989918f] to [6747f3c524].

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

54
55
56







57
58
24
25
26
27
28
29
30





31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49



50
51
52
53
54
55
56
57
58







-
-
-
-
-


















+
-
-
-
+
+
+
+
+
+
+


@synthesize condition = _condition;

+ (instancetype)exceptionWithCondition: (OFCondition*)condition
{
	return [[[self alloc] initWithCondition: condition] autorelease];
}

- init
{
	OF_INVALID_INIT_METHOD
}

- initWithCondition: (OFCondition*)condition
{
	self = [super init];

	_condition = [condition retain];

	return self;
}

- (void)dealloc
{
	[_condition release];

	[super dealloc];
}

- (OFString*)description
{
	if (_condition != nil)
	return [OFString stringWithFormat:
	    @"Deallocation of a condition of type %@ was tried, even though a "
	    @"thread was still waiting for it!", [_condition class]];
		return [OFString stringWithFormat:
		    @"Deallocation of a condition of type %@ was tried, even "
		    "though a thread was still waiting for it!",
		    [_condition class]];
	else
		return @"Deallocation of a condition was tried, even though a "
		    "thread was still waiting for it!";
}
@end

Modified src/exceptions/OFConditionWaitFailedException.h from [883461b962] to [509f0c4160].

16
17
18
19
20
21
22


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

41
42
43
44
45
46
47
48

49
50
51
52
53
54
55
56

57


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

42
43
44
45
46
47
48
49

50
51
52
53
54
55
56
57

58
59
60
61







+
+

















-
+







-
+







-
+

+
+

#import "OFException.h"

#ifndef OF_HAVE_THREADS
# error No threads available!
#endif

OF_ASSUME_NONNULL_BEGIN

@class OFCondition;

/*!
 * @class OFConditionWaitFailedException \
 *	  OFConditionWaitFailedException.h \
 *	  ObjFW/OFConditionWaitFailedException.h
 *
 * @brief An exception indicating waiting for a condition failed.
 */
@interface OFConditionWaitFailedException: OFException
{
	OFCondition *_condition;
}

/*!
 * The condition for which could not be waited.
 */
@property (readonly, nonatomic) OFCondition *condition;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFCondition *condition;

/*!
 * @brief Creates a new, autoreleased condition wait failed exception.
 *
 * @param condition The condition for which could not be waited
 * @return A new, autoreleased condition wait failed exception
 */
+ (instancetype)exceptionWithCondition: (OFCondition*)condition;
+ (instancetype)exceptionWithCondition: (nullable OFCondition*)condition;

/*!
 * @brief Initializes an already allocated condition wait failed exception.
 *
 * @param condition The condition for which could not be waited
 * @return An initialized condition wait failed exception
 */
- initWithCondition: (OFCondition*)condition;
- initWithCondition: (nullable OFCondition*)condition;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFConditionWaitFailedException.m from [974fd228f7] to [71f9cc7f2e].

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

54
55





56
57
24
25
26
27
28
29
30





31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49


50
51
52
53
54
55
56







-
-
-
-
-


















+
-
-
+
+
+
+
+


@synthesize condition = _condition;

+ (instancetype)exceptionWithCondition: (OFCondition*)condition
{
	return [[[self alloc] initWithCondition: condition] autorelease];
}

- init
{
	OF_INVALID_INIT_METHOD
}

- initWithCondition: (OFCondition*)condition
{
	self = [super init];

	_condition = [condition retain];

	return self;
}

- (void)dealloc
{
	[_condition release];

	[super dealloc];
}

- (OFString*)description
{
	if (_condition != nil)
	return [OFString stringWithFormat:
	    @"Waiting for a condition of type %@ failed!", [_condition class]];
		return [OFString stringWithFormat:
		    @"Waiting for a condition of type %@ failed!",
		    [_condition class]];
	else
		return @"Waiting for a condition failed!";
}
@end

Modified src/exceptions/OFConnectionFailedException.h from [c487229992] to [1c78b42463].

16
17
18
19
20
21
22


23
24
25
26
27
28
29
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31







+
+








#import "OFException.h"

#ifndef OF_HAVE_SOCKETS
# error No sockets available!
#endif

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFConnectionFailedException \
 *	  OFConnectionFailedException.h ObjFW/OFConnectionFailedException.h
 *
 * @brief An exception indicating that a connection could not be established.
 */
@interface OFConnectionFailedException: OFException
102
103
104
105
106
107
108


104
105
106
107
108
109
110
111
112







+
+
 * @return An initialized connection failed exception
 */
- initWithHost: (OFString*)host
	  port: (uint16_t)port
	socket: (id)socket
	 errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFCopyItemFailedException.h from [f24e8a9d1f] to [3689d773a6].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFCopyItemFailedException \
 *	  OFCopyItemFailedException.h ObjFW/OFCopyItemFailedException.h
 *
 * @brief An exception indicating that copying a item failed.
 */
@interface OFCopyItemFailedException: OFException
63
64
65
66
67
68
69


65
66
67
68
69
70
71
72
73







+
+
 * @param errNo The errno of the error that occurred
 * @return An initialized copy item failed exception
 */
- initWithSourcePath: (OFString*)sourcePath
     destinationPath: (OFString*)destinationPath
	       errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFCreateDirectoryFailedException.h from [a1fc5de069] to [ceed172fa5].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFCreateDirectoryFailedException \
 *	  OFCreateDirectoryFailedException.h \
 *	  ObjFW/OFCreateDirectoryFailedException.h
 *
 * @brief An exception indicating a directory couldn't be created.
 */
57
58
59
60
61
62
63


59
60
61
62
63
64
65
66
67







+
+
 *	       created
 * @param errNo The errno of the error that occurred
 * @return An initialized create directory failed exception
 */
- initWithPath: (OFString*)path
	 errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFCreateSymbolicLinkFailedException.h from [1236acb17b] to [0d686e2861].

12
13
14
15
16
17
18

19

20
21
22
23
24
25
26
12
13
14
15
16
17
18
19

20
21
22
23
24
25
26
27







+
-
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN
#if defined(OF_HAVE_SYMLINK) || defined(OF_WINDOWS)

/*!
 * @class OFCreateSymbolicLinkFailedException \
 *	  OFCreateSymbolicLinkFailedException.h \
 *	  ObjFW/OFCreateSymbolicLinkFailedException.h
 *
 * @brief An exception indicating that creating a symbolic link failed.
 */
87
88
89
90
91
92
93
94


88
89
90
91
92
93
94

95
96







-
+
+
 * @param errNo The errno of the error that occurred
 * @return An initialized create symbolic link failed exception
 */
- initWithSourcePath: (OFString*)sourcePath
     destinationPath: (OFString*)destinationPath
	       errNo: (int)errNo;
@end
#endif

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFCreateSymbolicLinkFailedException.m from [c7e1d4022d] to [3c148de5f6].

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
15
16
17
18
19
20
21

22
23
24
25
26
27
28







-







 */

#include "config.h"

#import "OFCreateSymbolicLinkFailedException.h"
#import "OFString.h"

#if defined(OF_HAVE_SYMLINK) || defined(OF_WINDOWS)
@implementation OFCreateSymbolicLinkFailedException
@synthesize sourcePath = _sourcePath, destinationPath = _destinationPath;
@synthesize errNo = _errNo;

+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath
			destinationPath: (OFString*)destinationPath
{
96
97
98
99
100
101
102
103
95
96
97
98
99
100
101








-
		    of_strerror(_errNo)];
	else
		return [OFString stringWithFormat:
		    @"Failed to create symbolic link %@ with destination %@!",
		    _destinationPath, _sourcePath];
}
@end
#endif

Modified src/exceptions/OFEnumerationMutationException.h from [7d375be5f4] to [d63fcd762c].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFEnumerationMutationException \
 *	  OFEnumerationMutationException.h \
 *	  ObjFW/OFEnumerationMutationException.h
 *
 * @brief An exception indicating that a mutation was detected during
 *        enumeration.
46
47
48
49
50
51
52


48
49
50
51
52
53
54
55
56







+
+
 * @brief Initializes an already allocated enumeration mutation exception.
 *
 * @param object The object which was mutated during enumeration
 * @return An initialized enumeration mutation exception
 */
- initWithObject: (id)object;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFException.h from [a76e5557c3] to [c5510791b2].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;
#ifndef DOXYGEN
@class OFArray OF_GENERIC(ObjectType);
@class OFMutableArray OF_GENERIC(ObjectType);
#endif

#define OF_BACKTRACE_SIZE 32
162
163
164
165
166
167
168
169

170
171
172
173
174
175
176
177
178


164
165
166
167
168
169
170

171
172
173
174
175
176
177
178
179
180
181
182







-
+









+
+

/*!
 * @brief Returns a backtrace of when the exception was created or nil if no
 *	  backtrace is available.
 *
 * @return A backtrace of when the exception was created
 */
- (OFArray*)backtrace;
- (nullable OFArray*)backtrace;
@end

#ifdef __cplusplus
extern "C" {
#endif
extern OFString* of_strerror(int errNo);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFGetOptionFailedException.h from [ac334310fe] to [be9a0844ee].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

@class OFStream;

/*!
 * @class OFGetOptionFailedException \
 *	  OFGetOptionFailedException.h ObjFW/OFGetOptionFailedException.h
 *
 * @brief An exception indicating that getting an option for a stream failed.
56
57
58
59
60
61
62


58
59
60
61
62
63
64
65
66







+
+
 * @param stream The stream for which the option could not be gotten
 * @param errNo The errno of the error that occurred
 * @return An initialized get option failed exception
 */
- initWithStream: (OFStream*)stream
	   errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFHTTPRequestFailedException.h from [3ca5a6b23c] to [40f50e7dcf].

16
17
18
19
20
21
22


23
24
25
26
27
28
29
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31







+
+








#import "OFException.h"

#ifndef OF_HAVE_SOCKETS
# error No sockets available!
#endif

OF_ASSUME_NONNULL_BEGIN

@class OFHTTPRequest;
@class OFHTTPResponse;

/*!
 * @class OFHTTPRequestFailedException \
 *	  OFHTTPRequestFailedException.h \
 *	  ObjFW/OFHTTPRequestFailedException.h
62
63
64
65
66
67
68


64
65
66
67
68
69
70
71
72







+
+
 * @param request The HTTP request which failed
 * @param response The response for the failed HTTP request
 * @return A new HTTP request failed exception
 */
- initWithRequest: (OFHTTPRequest*)request
	 response: (OFHTTPResponse*)response;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFHashAlreadyCalculatedException.h from [95e7141d60] to [74ab21b72f].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFHashAlreadyCalculatedException \
 *	  OFHashAlreadyCalculatedException.h \
 *	  ObjFW/OFHashAlreadyCalculatedException.h
 *
 * @brief An exception indicating that the hash has already been calculated.
 */
45
46
47
48
49
50
51


47
48
49
50
51
52
53
54
55







+
+
 * @brief Initializes an already allocated hash already calculated exception.
 *
 * @param object The hash which has already been calculated
 * @return An initialized hash already calculated exception
 */
- initWithObject: (id)object;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFInitializationFailedException.h from [e1ada3b28a] to [1e9473a74a].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

35
36
37
38
39
40
41
42

43
44
45
46
47
48
49
50

51


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

36
37
38
39
40
41
42
43

44
45
46
47
48
49
50
51

52
53
54
55







+
+















-
+







-
+







-
+

+
+
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFInitializationFailedException \
 *	  OFInitializationFailedException.h \
 *	  ObjFW/OFInitializationFailedException.h
 *
 * @brief An exception indicating that initializing something failed.
 */
@interface OFInitializationFailedException: OFException
{
	Class _inClass;
}

/*!
 * The class for which initialization failed.
 */
@property (readonly, nonatomic) Class inClass;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) Class inClass;

/*!
 * @brief Creates a new, autoreleased initialization failed exception.
 *
 * @param class_ The class for which initialization failed
 * @return A new, autoreleased initialization failed exception
 */
+ (instancetype)exceptionWithClass: (Class)class_;
+ (instancetype)exceptionWithClass: (nullable Class)class_;

/*!
 * @brief Initializes an already allocated initialization failed exception.
 *
 * @param class_ The class for which initialization failed
 * @return An initialized initialization failed exception
 */
- initWithClass: (Class)class_;
- initWithClass: (nullable Class)class_;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFInitializationFailedException.m from [cb8f7d260c] to [43347ab5a7].

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

46
47




48
49
23
24
25
26
27
28
29





30
31
32
33
34
35
36
37
38
39
40
41


42
43
44
45
46
47







-
-
-
-
-











+
-
-
+
+
+
+


@synthesize inClass = _inClass;

+ (instancetype)exceptionWithClass: (Class)class
{
	return [[[self alloc] initWithClass: class] autorelease];
}

- init
{
	OF_INVALID_INIT_METHOD
}

- initWithClass: (Class)class
{
	self = [super init];

	_inClass = class;

	return self;
}

- (OFString*)description
{
	if (_inClass != Nil)
	return [OFString stringWithFormat:
	    @"Initialization failed for or in class %@!", _inClass];
		return [OFString stringWithFormat:
		    @"Initialization failed for or in class %@!", _inClass];
	else
		return @"Initialization failed!";
}
@end

Modified src/exceptions/OFInvalidArgumentException.h from [569d018538] to [ee2e459672].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30







+
+








+
+
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFInvalidArgumentException \
 *	  OFInvalidArgumentException.h ObjFW/OFInvalidArgumentException.h
 *
 * @brief An exception indicating that the argument is invalid for this method.
 */
@interface OFInvalidArgumentException: OFException
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFInvalidEncodingException.h from [84ddd8e7e5] to [0fdff9d803].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30







+
+








+
+
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFInvalidEncodingException \
 *	  OFInvalidEncodingException.h ObjFW/OFInvalidEncodingException.h
 *
 * @brief An exception indicating that the encoding is invalid for this object.
 */
@interface OFInvalidEncodingException: OFException
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFInvalidFormatException.h from [f5633f7079] to [1757ea3ab2].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30







+
+








+
+
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFInvalidFormatException \
 *	  OFInvalidFormatException.h ObjFW/OFInvalidFormatException.h
 *
 * @brief An exception indicating that the format is invalid.
 */
@interface OFInvalidFormatException: OFException
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFInvalidJSONException.h from [958d67c1a9] to [3515e6b03e].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFInvalidJSONException \
 *	  OFInvalidJSONException.h ObjFW/OFInvalidJSONException.h
 *
 * @brief An exception indicating a JSON representation is invalid.
 */
@interface OFInvalidJSONException: OFException
54
55
56
57
58
59
60


56
57
58
59
60
61
62
63
64







+
+
 * @param string The string containing the invalid JSON representation
 * @param line The line in which the parsing error was encountered
 * @return An initialized invalid JSON exception
 */
- initWithString: (OFString*)string
	    line: (size_t)line;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFInvalidServerReplyException.h from [66547d927a] to [0e9f35aaa7].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30







+
+








+
+
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFInvalidServerReplyException \
 *	  OFInvalidServerReplyException.h ObjFW/OFInvalidServerReplyException.h
 *
 * @brief An exception indicating that the server sent an invalid reply.
 */
@interface OFInvalidServerReplyException: OFException
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFLinkFailedException.h from [ecccdc69a0] to [330c1ca862].

12
13
14
15
16
17
18

19

20
21
22
23
24
25
26
12
13
14
15
16
17
18
19

20
21
22
23
24
25
26
27







+
-
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN
#if defined(OF_HAVE_LINK) || defined(OF_WINDOWS)

/*!
 * @class OFLinkFailedException \
 *	  OFLinkFailedException.h ObjFW/OFLinkFailedException.h
 *
 * @brief An exception indicating that creating a link failed.
 */
@interface OFLinkFailedException: OFException
84
85
86
87
88
89
90
91


85
86
87
88
89
90
91

92
93







-
+
+
 * @param errNo The errno of the error that occurred
 * @return An initialized link failed exception
 */
- initWithSourcePath: (OFString*)sourcePath
     destinationPath: (OFString*)destinationPath
	       errNo: (int)errNo;
@end
#endif

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFLinkFailedException.m from [66bdc21727] to [22b0d59c65].

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
15
16
17
18
19
20
21

22
23
24
25
26
27
28







-







 */

#include "config.h"

#import "OFLinkFailedException.h"
#import "OFString.h"

#if defined(OF_HAVE_LINK) || defined(OF_WINDOWS)
@implementation OFLinkFailedException
@synthesize sourcePath = _sourcePath, destinationPath = _destinationPath;
@synthesize errNo = _errNo;

+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath
			destinationPath: (OFString*)destinationPath
{
95
96
97
98
99
100
101
102
94
95
96
97
98
99
100








-
		    _sourcePath, _destinationPath, of_strerror(_errNo)];
	else
		return [OFString stringWithFormat:
		    @"Failed to link file %@ to %@!",
		    _sourcePath, _destinationPath];
}
@end
#endif

Modified src/exceptions/OFListenFailedException.h from [7e1a5af823] to [b8e6cc5049].

16
17
18
19
20
21
22


23
24
25
26
27
28
29
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31







+
+








#import "OFException.h"

#ifndef OF_HAVE_SOCKETS
# error No sockets available!
#endif

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFListenFailedException \
 *	  OFListenFailedException.h ObjFW/OFListenFailedException.h
 *
 * @brief An exception indicating that listening on the socket failed.
 */
@interface OFListenFailedException: OFException
67
68
69
70
71
72
73


69
70
71
72
73
74
75
76
77







+
+
 * @param errNo The errno of the error that occurred
 * @return An initialized listen failed exception
 */
- initWithSocket: (id)socket
	 backLog: (int)backLog
	   errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFLockFailedException.h from [e653096b8b] to [6569cc0a3f].

13
14
15
16
17
18
19


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

35
36
37
38
39
40
41
42

43
44
45
46
47
48
49
50

51


13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

36
37
38
39
40
41
42
43

44
45
46
47
48
49
50
51

52
53
54
55







+
+














-
+







-
+







-
+

+
+
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"
#import "OFLocking.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFLockFailedException \
 *	  OFLockFailedException.h ObjFW/OFLockFailedException.h
 *
 * @brief An exception indicating that locking a lock failed.
 */
@interface OFLockFailedException: OFException
{
	id <OFLocking> _lock;
}

/*!
 * The lock which could not be locked.
 */
@property (readonly, nonatomic) id <OFLocking> lock;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) id <OFLocking> lock;

/*!
 * @brief Creates a new, autoreleased lock failed exception.
 *
 * @param lock The lock which could not be locked
 * @return A new, autoreleased lock failed exception
 */
+ (instancetype)exceptionWithLock: (id <OFLocking>)lock;
+ (instancetype)exceptionWithLock: (nullable id <OFLocking>)lock;

/*!
 * @brief Initializes an already allocated lock failed exception.
 *
 * @param lock The lock which could not be locked
 * @return An initialized lock failed exception
 */
- initWithLock: (id <OFLocking>)lock;
- initWithLock: (nullable id <OFLocking>)lock;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFMalformedXMLException.h from [45e5c7b12b] to [969464470b].

14
15
16
17
18
19
20


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

36
37
38
39
40
41
42
43

44
45
46
47
48
49
50
51

52


14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

37
38
39
40
41
42
43
44

45
46
47
48
49
50
51
52

53
54
55
56







+
+














-
+







-
+







-
+

+
+
 * file.
 */

#import "OFException.h"

@class OFXMLParser;

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFMalformedXMLException \
 *	  OFMalformedXMLException.h ObjFW/OFMalformedXMLException.h
 *
 * @brief An exception indicating that a parser encountered malformed XML.
 */
@interface OFMalformedXMLException: OFException
{
	OFXMLParser *_parser;
}

/*!
 * The parser which encountered malformed XML.
 */
@property (readonly, nonatomic) OFXMLParser *parser;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFXMLParser *parser;

/*!
 * @brief Creates a new, autoreleased malformed XML exception.
 *
 * @param parser The parser which encountered malformed XML
 * @return A new, autoreleased malformed XML exception
 */
+ (instancetype)exceptionWithParser: (OFXMLParser*)parser;
+ (instancetype)exceptionWithParser: (nullable OFXMLParser*)parser;

/*!
 * @brief Initializes an already allocated malformed XML exception.
 *
 * @param parser The parser which encountered malformed XML
 * @return An initialized malformed XML exception
 */
- initWithParser: (OFXMLParser*)parser;
- initWithParser: (nullable OFXMLParser*)parser;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFMemoryNotPartOfObjectException.h from [1e0be12e1f] to [e71e1b14f0].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFMemoryNotPartOfObjectException \
 *	  OFMemoryNotPartOfObjectException.h \
 *	  ObjFW/OFMemoryNotPartOfObjectException.h
 *
 * @brief An exception indicating the given memory is not part of the object.
 */
55
56
57
58
59
60
61


57
58
59
60
61
62
63
64
65







+
+
 * @param pointer A pointer to the memory that is not part of the object
 * @param object The object which the memory is not part of
 * @return An initialized memory not part of object exception
 */
- initWithPointer: (void*)pointer
	   object: (id)object;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFMoveItemFailedException.h from [a65ba57dc8] to [220654d393].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFMoveItemFailedException \
 *	  OFMoveItemFailedException.h ObjFW/OFMoveItemFailedException.h
 *
 * @brief An exception indicating that moving an item failed.
 */
@interface OFMoveItemFailedException: OFException
63
64
65
66
67
68
69


65
66
67
68
69
70
71
72
73







+
+
 * @param errNo The errno of the error that occurred
 * @return An initialized move item failed exception
 */
- initWithSourcePath: (OFString*)sourcePath
     destinationPath: (OFString*)destinationPath
	       errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFNotImplementedException.h from [0d230b7593] to [531d5e413e].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFNotImplementedException \
 *	  OFNotImplementedException.h ObjFW/OFNotImplementedException.h
 *
 * @brief An exception indicating that a method or part of it is not
 *        implemented.
 */
55
56
57
58
59
60
61


57
58
59
60
61
62
63
64
65







+
+
 * @param selector The selector which is not or not fully implemented
 * @param object The object which does not (fully) implement the selector
 * @return An initialized not implemented exception
 */
- initWithSelector: (SEL)selector
	    object: (id)object;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFNotOpenException.h from [d9c378372c] to [5627231c5d].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFNotOpenException OFNotOpenException.h ObjFW/OFNotOpenException.h
 *
 * @brief An exception indicating an object is not open, connected or bound.
 */
@interface OFNotOpenException: OFException
{
43
44
45
46
47
48
49


45
46
47
48
49
50
51
52
53







+
+
 * @brief Initializes an already allocated not open exception.
 *
 * @param object The object which is not open, connected or bound
 * @return An initialized not open exception
 */
- initWithObject: (id)object;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFObserveFailedException.h from [e5acc95b6a] to [032d2564af].

11
12
13
14
15
16
17


18
19
20
21
22
23
24
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26







+
+







 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

@class OFKernelEventObserver;

/*!
 * @class OFObserveFailedException \
 *	  OFObserveFailedException.h ObjFW/OFObserveFailedException.h
 *
56
57
58
59
60
61
62


58
59
60
61
62
63
64
65
66







+
+
 * @param observer The observer which failed to observe
 * @param errNo The errno of the error that occurred
 * @return An initialized observe failed exception
 */
- initWithObserver: (OFKernelEventObserver*)observer
	     errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFOpenItemFailedException.h from [f942b5ed03] to [7e4d67733e].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

40
41
42
43
44
45
46
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

41
42
43
44
45
46
47
48







+
+




















-
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFOpenItemFailedException \
 *	  OFOpenItemFailedException.h ObjFW/OFOpenItemFailedException.h
 *
 * @brief An exception indicating an item could not be opened.
 */
@interface OFOpenItemFailedException: OFException
{
	OFString *_path, *_mode;
	int _errNo;
}

/*!
 * The path of the item which could not be opened.
 */
@property (readonly, nonatomic) OFString *path;

/*!
 * The mode in which the item should have been opened.
 */
@property (readonly, nonatomic) OFString *mode;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *mode;

/*!
 * The errno of the error that occurred.
 */
@property (readonly) int errNo;

/*!
55
56
57
58
59
60
61
62

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102

103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123

124
125


57
58
59
60
61
62
63

64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124

125
126
127
128
129







-
+




















-
+


















-
+




















-
+


+
+
 * @brief Creates a new, autoreleased open item failed exception.
 *
 * @param path A string with the path of the item tried to open
 * @param mode A string with the mode in which the item should have been opened
 * @return A new, autoreleased open item failed exception
 */
+ (instancetype)exceptionWithPath: (OFString*)path
			     mode: (OFString*)mode;
			     mode: (nullable OFString*)mode;

/*!
 * @brief Creates a new, autoreleased open item failed exception.
 *
 * @param path A string with the path of the item tried to open
 * @param errNo The errno of the error that occurred
 * @return A new, autoreleased open item failed exception
 */
+ (instancetype)exceptionWithPath: (OFString*)path
			    errNo: (int)errNo;

/*!
 * @brief Creates a new, autoreleased open item failed exception.
 *
 * @param path A string with the path of the item tried to open
 * @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: (OFString*)mode
			     mode: (nullable OFString*)mode
			    errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated open item failed exception.
 *
 * @param path A string with the path of the item which could not be opened
 * @return An initialized open item failed exception
 */
- initWithPath: (OFString*)path;

/*!
 * @brief Initializes an already allocated open item failed exception.
 *
 * @param path A string with 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
 * @return An initialized open item failed exception
 */
- initWithPath: (OFString*)path
	  mode: (OFString*)mode;
	  mode: (nullable OFString*)mode;

/*!
 * @brief Initializes an already allocated open item failed exception.
 *
 * @param path A string with the path of the item which could not be opened
 * @param errNo The errno of the error that occurred
 * @return An initialized open item failed exception
 */
- initWithPath: (OFString*)path
	 errNo: (int)errNo;

/*!
 * @brief Initializes an already allocated open item failed exception.
 *
 * @param path A string with 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
 */
- initWithPath: (OFString*)path
	  mode: (OFString*)mode
	  mode: (nullable OFString*)mode
	 errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFOutOfMemoryException.h from [6b0f084823] to [6df6fe3bd8].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFOutOfMemoryException \
 *	  OFOutOfMemoryException.h ObjFW/OFOutOfMemoryException.h
 *
 * @brief An exception indicating there is not enough memory available.
 */
@interface OFOutOfMemoryException: OFException
44
45
46
47
48
49
50


46
47
48
49
50
51
52
53
54







+
+
 * @brief Initializes an already allocated no memory exception.
 *
 * @param requestedSize The size of the memory that could not be allocated
 * @return An initialized no memory exception
 */
- initWithRequestedSize: (size_t)requestedSize;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFOutOfRangeException.h from [1706efd9a9] to [6db4c61406].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30







+
+








+
+
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFOutOfRangeException \
 *	  OFOutOfRangeException.h ObjFW/OFOutOfRangeException.h
 *
 * @brief An exception indicating the given value is out of range.
 */
@interface OFOutOfRangeException: OFException
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFReadFailedException.h from [e35f1e50a5] to [a5477eee53].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30







+
+








+
+
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFReadOrWriteFailedException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFReadFailedException \
 *	  OFReadFailedException.h ObjFW/OFReadFailedException.h
 *
 * @brief An exception indicating that reading from an object failed.
 */
@interface OFReadFailedException: OFReadOrWriteFailedException
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFReadOrWriteFailedException.h from [1d7baf9f13] to [a2f7b8f9df].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFReadOrWriteFailedException \
 *	  OFReadOrWriteFailedException.h ObjFW/OFReadOrWriteFailedException.h
 *
 * @brief An exception indicating that reading from or writing to an object
 *	  failed.
 */
89
90
91
92
93
94
95


91
92
93
94
95
96
97
98
99







+
+
 * @param errNo The errno of the error that occurred
 * @return A new open file failed exception
 */
-  initWithObject: (id)object
  requestedLength: (size_t)requestedLength
	    errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFRemoveItemFailedException.h from [748863371b] to [69fce99bc1].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFRemoveItemFailedException \
 *	  OFRemoveItemFailedException.h ObjFW/OFRemoveItemFailedException.h
 *
 * @brief An exception indicating that removing an item failed.
 */
@interface OFRemoveItemFailedException: OFException
54
55
56
57
58
59
60


56
57
58
59
60
61
62
63
64







+
+
 * @param path The path of the item which could not be removed
 * @param errNo The errno of the error that occurred
 * @return An initialized remove item failed exception
 */
- initWithPath: (OFString*)path
	 errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFSandboxActivationFailedException.h from [f657c2f2e0] to [b24879b2d6].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

@class OFSandbox;

/*!
 * @class OFSandboxActivationFailedException \
 *	  OFSandboxActivationFailedException.h \
 *	  ObjFW/OFSandboxActivationFailedException.h
 *
57
58
59
60
61
62
63


59
60
61
62
63
64
65
66
67







+
+
 * @param sandbox The sandbox which could not be activated
 * @param errNo The errno of the error that occurred
 * @return An initialized sandboxing failed exception
 */
- initWithSandbox: (OFSandbox*)sandbox
	    errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFSeekFailedException.h from [f18e917b11] to [1e5a86504e].

13
14
15
16
17
18
19


20
21
22
23
24
25
26
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28







+
+







 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"
#import "OFSeekableStream.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFSeekFailedException \
 *	  OFSeekFailedException.h ObjFW/OFSeekFailedException.h
 *
 * @brief An exception indicating that seeking in a stream failed.
 */
@interface OFSeekFailedException: OFException
74
75
76
77
78
79
80


76
77
78
79
80
81
82
83
84







+
+
 * @return An initialized seek failed exception
 */
- initWithStream: (OFSeekableStream*)stream
	  offset: (of_offset_t)offset
	  whence: (int)whence
	   errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFSetOptionFailedException.h from [a575eb3117] to [7844ba8833].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

@class OFStream;

/*!
 * @class OFSetOptionFailedException \
 *	  OFSetOptionFailedException.h ObjFW/OFSetOptionFailedException.h
 *
 * @brief An exception indicating that setting an option for a stream failed.
56
57
58
59
60
61
62


58
59
60
61
62
63
64
65
66







+
+
 * @param stream The stream for which the option could not be set
 * @param errNo The errno of the error that occurred
 * @return An initialized set option failed exception
 */
- initWithStream: (OFStream*)stream
	   errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFStatItemFailedException.h from [64e41887bc] to [34fa416e50].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFStatItemFailedException \
 *	  OFStatItemFailedException.h ObjFW/OFStatItemFailedException.h
 *
 * @brief An exception indicating an item's status could not be retrieved.
 */
@interface OFStatItemFailedException: OFException
74
75
76
77
78
79
80


76
77
78
79
80
81
82
83
84







+
+
 *	       retrieved
 * @param errNo The errno of the error that occurred
 * @return An initialized stat item failed exception
 */
- initWithPath: (OFString*)path
	 errNo: (int)errNo;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFStillLockedException.h from [54b7fb893b] to [a95128b6c6].

13
14
15
16
17
18
19


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

35
36
37
38
39
40
41
42

43
44
45
46
47
48
49
50

51


13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

36
37
38
39
40
41
42
43

44
45
46
47
48
49
50
51

52
53
54
55







+
+














-
+







-
+







-
+

+
+
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"
#import "OFLocking.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFStillLockedException \
 *	  OFStillLockedException.h ObjFW/OFStillLockedException.h
 *
 * @brief An exception indicating that a lock is still locked.
 */
@interface OFStillLockedException: OFException
{
	id <OFLocking> _lock;
}

/*!
 * The lock which is still locked.
 */
@property (readonly, nonatomic) id <OFLocking> lock;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) id <OFLocking> lock;

/*!
 * @brief Creates a new, autoreleased still locked exception.
 *
 * @param lock The lock which is still locked
 * @return A new, autoreleased still locked exception
 */
+ (instancetype)exceptionWithLock: (id <OFLocking>)lock;
+ (instancetype)exceptionWithLock: (nullable id <OFLocking>)lock;

/*!
 * @brief Initializes an already allocated still locked exception.
 *
 * @param lock The lock which is still locked
 * @return An initialized still locked exception
 */
- initWithLock: (id <OFLocking>)lock;
- initWithLock: (nullable id <OFLocking>)lock;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFThreadJoinFailedException.h from [b0a33d7256] to [45c508a2e4].

16
17
18
19
20
21
22


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

40
41
42
43
44
45
46
47

48
49
50
51
52
53
54
55

56


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

41
42
43
44
45
46
47
48

49
50
51
52
53
54
55
56

57
58
59
60







+
+
















-
+







-
+







-
+

+
+

#import "OFException.h"

#ifndef OF_HAVE_THREADS
# error No threads available!
#endif

OF_ASSUME_NONNULL_BEGIN

@class OFThread;

/*!
 * @class OFThreadJoinFailedException \
 *	  OFThreadJoinFailedException.h ObjFW/OFThreadJoinFailedException.h
 *
 * @brief An exception indicating that joining a thread failed.
 */
@interface OFThreadJoinFailedException: OFException
{
	OFThread *_thread;
}

/*!
 * The thread which could not be joined.
 */
@property (readonly, nonatomic) OFThread *thread;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFThread *thread;

/*!
 * @brief Creates a new, autoreleased thread join failed exception.
 *
 * @param thread The thread which could not be joined
 * @return A new, autoreleased thread join failed exception
 */
+ (instancetype)exceptionWithThread: (OFThread*)thread;
+ (instancetype)exceptionWithThread: (nullable OFThread*)thread;

/*!
 * @brief Initializes an already allocated thread join failed exception.
 *
 * @param thread The thread which could not be joined
 * @return An initialized thread join failed exception
 */
- initWithThread: (OFThread*)thread;
- initWithThread: (nullable OFThread*)thread;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFThreadJoinFailedException.m from [66ca4d5ea2] to [c4c229f651].

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

54
55
56







57
58
24
25
26
27
28
29
30





31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49



50
51
52
53
54
55
56
57
58







-
-
-
-
-


















+
-
-
-
+
+
+
+
+
+
+


@synthesize thread = _thread;

+ (instancetype)exceptionWithThread: (OFThread*)thread
{
	return [[[self alloc] initWithThread: thread] autorelease];
}

- init
{
	OF_INVALID_INIT_METHOD
}

- initWithThread: (OFThread*)thread
{
	self = [super init];

	_thread = [thread retain];

	return self;
}

- (void)dealloc
{
	[_thread release];

	[super dealloc];
}

- (OFString*)description
{
	if (_thread != nil)
	return [OFString stringWithFormat:
	    @"Joining a thread of type %@ failed! Most likely, another thread "
	    @"already waits for the thread to join.", [_thread class]];
		return [OFString stringWithFormat:
		    @"Joining a thread of type %@ failed! Most likely, another "
		    @"thread already waits for the thread to join.",
		    [_thread class]];
	else
		return @"Joining a thread failed! Most likely, another thread "
		    @"already waits for the thread to join.";
}
@end

Modified src/exceptions/OFThreadStartFailedException.h from [f57d5292ab] to [1927c7649a].

16
17
18
19
20
21
22


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

40
41
42
43
44
45
46
47

48
49
50
51
52
53
54
55

56


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

41
42
43
44
45
46
47
48

49
50
51
52
53
54
55
56

57
58
59
60







+
+
















-
+







-
+







-
+

+
+

#import "OFException.h"

#ifndef OF_HAVE_THREADS
# error No threads available!
#endif

OF_ASSUME_NONNULL_BEGIN

@class OFThread;

/*!
 * @class OFThreadStartFailedException \
 *	  OFThreadStartFailedException.h ObjFW/OFThreadStartFailedException.h
 *
 * @brief An exception indicating that starting a thread failed.
 */
@interface OFThreadStartFailedException: OFException
{
	OFThread *_thread;
}

/*!
 * The thread which could not be started.
 */
@property (readonly, nonatomic) OFThread *thread;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFThread *thread;

/*!
 * @brief Creates a new, autoreleased thread start failed exception.
 *
 * @param thread The thread which could not be started
 * @return A new, autoreleased thread start failed exception
 */
+ (instancetype)exceptionWithThread: (OFThread*)thread;
+ (instancetype)exceptionWithThread: (nullable OFThread*)thread;

/*!
 * @brief Initializes an already allocated thread start failed exception.
 *
 * @param thread The thread which could not be started
 * @return An initialized thread start failed exception
 */
- initWithThread: (OFThread*)thread;
- initWithThread: (nullable OFThread*)thread;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFThreadStartFailedException.m from [dbacd6f57c] to [ab02e3a892].

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

54
55




56
57
24
25
26
27
28
29
30





31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49


50
51
52
53
54
55







-
-
-
-
-


















+
-
-
+
+
+
+


@synthesize thread = _thread;

+ (instancetype)exceptionWithThread: (OFThread*)thread
{
	return [[[self alloc] initWithThread: thread] autorelease];
}

- init
{
	OF_INVALID_INIT_METHOD
}

- initWithThread: (OFThread*)thread
{
	self = [super init];

	_thread = [thread retain];

	return self;
}

- (void)dealloc
{
	[_thread release];

	[super dealloc];
}

- (OFString*)description
{
	if (_thread != nil)
	return [OFString stringWithFormat:
	    @"Starting a thread of type %@ failed!", [_thread class]];
		return [OFString stringWithFormat:
		    @"Starting a thread of type %@ failed!", [_thread class]];
	else
		return @"Starting a thread failed!";
}
@end

Modified src/exceptions/OFThreadStillRunningException.h from [a7e0dd9484] to [d5d503dfe2].

16
17
18
19
20
21
22


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

40
41
42
43
44
45
46
47

48
49
50
51
52
53
54
55

56


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

41
42
43
44
45
46
47
48

49
50
51
52
53
54
55
56

57
58
59
60







+
+
















-
+







-
+







-
+

+
+

#import "OFException.h"

#ifndef OF_HAVE_THREADS
# error No threads available!
#endif

OF_ASSUME_NONNULL_BEGIN

@class OFThread;

/*!
 * @class OFThreadStillRunningException \
 *	  OFThreadStillRunningException.h ObjFW/OFThreadStillRunningException.h
 *
 * @brief An exception indicating that a thread is still running.
 */
@interface OFThreadStillRunningException: OFException
{
	OFThread *_thread;
}

/*!
 * The thread which is still running.
 */
@property (readonly, retain) OFThread *thread;
@property OF_NULLABLE_PROPERTY (readonly, retain) OFThread *thread;

/*!
 * @brief Creates a new, autoreleased thread still running exception.
 *
 * @param thread The thread which is still running
 * @return A new, autoreleased thread still running exception
 */
+ (instancetype)exceptionWithThread: (OFThread*)thread;
+ (instancetype)exceptionWithThread: (nullable OFThread*)thread;

/*!
 * @brief Initializes an already allocated thread still running exception.
 *
 * @param thread The thread which is still running
 * @return An initialized thread still running exception
 */
- initWithThread: (OFThread*)thread;
- initWithThread: (nullable OFThread*)thread;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFThreadStillRunningException.m from [52837c82ec] to [7f6b444bcd].

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

54
55
56







57
58
24
25
26
27
28
29
30





31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49



50
51
52
53
54
55
56
57
58







-
-
-
-
-


















+
-
-
-
+
+
+
+
+
+
+


@synthesize thread = _thread;

+ (instancetype)exceptionWithThread: (OFThread*)thread
{
	return [[[self alloc] initWithThread: thread] autorelease];
}

- init
{
	OF_INVALID_INIT_METHOD
}

- initWithThread: (OFThread*)thread
{
	self = [super init];

	_thread = [thread retain];

	return self;
}

- (void)dealloc
{
	[_thread release];

	[super dealloc];
}

- (OFString*)description
{
	if (_thread)
	return [OFString stringWithFormat:
	    @"Deallocation of a thread of type %@ was tried, even though it "
	    @"was still running!", [_thread class]];
		return [OFString stringWithFormat:
		    @"Deallocation of a thread of type %@ was tried, even "
		    @"though it was still running!",
		    [_thread class]];
	else
		return @"Deallocation of a thread was tried, even though it "
		    @"was still running!";
}
@end

Modified src/exceptions/OFTruncatedDataException.h from [2ade25e447] to [7adec56dc7].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31







+
+









+
+
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFTruncatedDataException \
 *	  OFTruncatedDataException.h ObjFW/OFTruncatedDataException.h
 *
 * @brief An exception indicating that data was truncated while it should not
 *	  have been truncated.
 */
@interface OFTruncatedDataException: OFException
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFUnboundNamespaceException.h from [debc56d522] to [b5af7ca552].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

@class OFXMLElement;

/*!
 * @class OFUnboundNamespaceException \
 *	  OFUnboundNamespaceException.h ObjFW/OFUnboundNamespaceException.h
 *
 * @brief An exception indicating an attempt to use an unbound namespace.
60
61
62
63
64
65
66


62
63
64
65
66
67
68
69
70







+
+
 * @param namespace_ The namespace which is unbound
 * @param element The element in which the namespace was not bound
 * @return An initialized unbound namespace exception
 */
- initWithNamespace: (OFString*)namespace_
	    element: (OFXMLElement*)element;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFUnboundPrefixException.h from [a71ff8c82b] to [85076c578b].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

@class OFXMLParser;

/*!
 * @class OFUnboundPrefixException \
 *	  OFUnboundPrefixException.h ObjFW/OFUnboundPrefixException.h
 *
 * @brief An exception indicating an attempt to use an unbound prefix.
56
57
58
59
60
61
62


58
59
60
61
62
63
64
65
66







+
+
 * @param prefix The prefix which is unbound
 * @param parser The parser which encountered the unbound prefix
 * @return An initialized unbound prefix exception
 */
- initWithPrefix: (OFString*)prefix
	  parser: (OFXMLParser*)parser;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFUndefinedKeyException.h from [f9eca6d772] to [a2963e0e91].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFUndefinedKeyException \
 *	  OFUndefinedKeyException.h ObjFW/OFUndefinedKeyException.h
 *
 * @brief An exception indicating that a key for Key Value Coding is undefined.
 */
@interface OFUndefinedKeyException: OFException
88
89
90
91
92
93
94


90
91
92
93
94
95
96
97
98







+
+
 *
 * @return An initialized undefined key exception
 */
- initWithObject: (id)object
	     key: (OFString*)key
	   value: (id)value;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFUnknownXMLEntityException.h from [0621e944b7] to [5738d0e30e].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFUnknownXMLEntityException \
 *	  OFUnknownXMLEntityException.h ObjFW/OFUnknownXMLEntityException.h
 *
 * @brief An exception indicating that a parser encountered an unknown XML
 *	  entity.
 */
45
46
47
48
49
50
51


47
48
49
50
51
52
53
54
55







+
+
 * @brief Initializes an already allocated unknown XML entity exception.
 *
 * @param entityName The name of the unknown XML entity
 * @return An initialized unknown XML entity exception
 */
- initWithEntityName: (OFString*)entityName;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFUnlockFailedException.h from [c826d237ba] to [322f56e8eb].

13
14
15
16
17
18
19


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

35
36
37
38
39
40
41
42

43
44
45
46
47
48
49
50

51


13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

36
37
38
39
40
41
42
43

44
45
46
47
48
49
50
51

52
53
54
55







+
+














-
+







-
+







-
+

+
+
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"
#import "OFLocking.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFUnlockFailedException \
 *	  OFUnlockFailedException.h ObjFW/OFUnlockFailedException.h
 *
 * @brief An exception indicating that unlocking a lock failed.
 */
@interface OFUnlockFailedException: OFException
{
	id <OFLocking> _lock;
}

/*!
 * The lock which could not be unlocked.
 */
@property (readonly, nonatomic) id <OFLocking> lock;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) id <OFLocking> lock;

/*!
 * @brief Creates a new, autoreleased unlock failed exception.
 *
 * @param lock The lock which could not be unlocked
 * @return A new, autoreleased unlock failed exception
 */
+ (instancetype)exceptionWithLock: (id <OFLocking>)lock;
+ (instancetype)exceptionWithLock: (nullable id <OFLocking>)lock;

/*!
 * @brief Initializes an already allocated unlock failed exception.
 *
 * @param lock The lock which could not be unlocked
 * @return An initialized unlock failed exception
 */
- initWithLock: (id <OFLocking>)lock;
- initWithLock: (nullable id <OFLocking>)lock;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFUnsupportedProtocolException.h from [18c828c8b6] to [1f873f9565].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

@class OFURL;

/*!
 * @class OFUnsupportedProtocolException \
 *	  OFUnsupportedProtocolException.h \
 *	  ObjFW/OFUnsupportedProtocolException.h
 *
48
49
50
51
52
53
54


50
51
52
53
54
55
56
57
58







+
+
 * @brief Initializes an already allocated unsupported protocol exception
 *
 * @param URL The URL whose protocol is unsupported
 * @return An initialized unsupported protocol exception
 */
- initWithURL: (OFURL*)URL;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFUnsupportedVersionException.h from [9f155bbade] to [b5d4712496].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFUnsupportedVersionException \
 *	  OFUnsupportedVersionException.h ObjFW/OFUnsupportedVersionException.h
 *
 * @brief An exception indicating that the specified version of the format or
 *	  protocol is not supported.
 */
45
46
47
48
49
50
51


47
48
49
50
51
52
53
54
55







+
+
 * @brief Initializes an already allocated unsupported protocol exception.
 *
 * @param version The version which is unsupported
 * @return An initialized unsupported version exception
 */
- initWithVersion: (OFString*)version;
@end

OF_ASSUME_NONNULL_END

Modified src/exceptions/OFWriteFailedException.h from [3548bb003a] to [65c0a33d30].

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30







+
+








+
+
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFReadOrWriteFailedException.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFWriteFailedException \
 *	  OFWriteFailedException.h ObjFW/OFWriteFailedException.h
 *
 * @brief An exception indicating that writing to an object failed.
 */
@interface OFWriteFailedException: OFReadOrWriteFailedException
@end

OF_ASSUME_NONNULL_END