ObjFW  Diff

Differences From Artifact [eb706ff06f]:

To Artifact [b3820ad5f4]:


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
83
84
85
86
87

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

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

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

+ (instancetype)exceptionWithError: (int)error
{
	return [[[self alloc] initWithError: error] autorelease];
}

- initWithHost: (OFString*)host
{
	self = [super init];

	@try {
		_host = [host copy];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (instancetype)initWithHost: (OFString*)host
		       error: (int)error
{
	self = [super init];

	@try {
		_host = [host copy];
		_error = error;







|




|











|













|







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
83
84
85
86
87

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

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

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

+ (instancetype)exceptionWithError: (int)error
{
	return [[[self alloc] initWithError: error] autorelease];
}

- initWithHost: (OFString *)host
{
	self = [super init];

	@try {
		_host = [host copy];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (instancetype)initWithHost: (OFString *)host
		       error: (int)error
{
	self = [super init];

	@try {
		_host = [host copy];
		_error = error;
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
- (void)dealloc
{
	[_host release];

	[super dealloc];
}

- (OFString*)description
{
	/* FIXME: Add proper description for Win32 */
#ifndef OF_WINDOWS
	if (_error == 0) {
#endif
		if (_host != nil)
			return [OFString stringWithFormat:







|







105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
- (void)dealloc
{
	[_host release];

	[super dealloc];
}

- (OFString *)description
{
	/* FIXME: Add proper description for Win32 */
#ifndef OF_WINDOWS
	if (_error == 0) {
#endif
		if (_host != nil)
			return [OFString stringWithFormat: