mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-15 10:23:57 +00:00
Raise NSExceptions instead of using -error:.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1214 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6165857149
commit
e7667dd5ed
1 changed files with 18 additions and 10 deletions
|
@ -133,9 +133,11 @@ static id tmp_kludge_protocol = nil;
|
||||||
- (void) encodeWithCoder: aRmc
|
- (void) encodeWithCoder: aRmc
|
||||||
{
|
{
|
||||||
if (![_connection isValid])
|
if (![_connection isValid])
|
||||||
[self error: "Trying to encode an invalid Proxy.\n"
|
[NSException
|
||||||
"You should request ConnectionBecameInvalidNotification's and\n"
|
raise: NSGenericException
|
||||||
"remove all references to the Proxy's of invalid Connections."];
|
format: @"Trying to encode an invalid Proxy.\n"
|
||||||
|
@"You should request ConnectionBecameInvalidNotification's and\n"
|
||||||
|
@"remove all references to the Proxy's of invalid Connections."];
|
||||||
[[self classForConnectedCoder: aRmc]
|
[[self classForConnectedCoder: aRmc]
|
||||||
encodeObject: self withConnectedCoder: aRmc];
|
encodeObject: self withConnectedCoder: aRmc];
|
||||||
}
|
}
|
||||||
|
@ -177,9 +179,11 @@ enum
|
||||||
encoder_connection = [aRmc connection];
|
encoder_connection = [aRmc connection];
|
||||||
assert (encoder_connection);
|
assert (encoder_connection);
|
||||||
if (![encoder_connection isValid])
|
if (![encoder_connection isValid])
|
||||||
[self error: "Trying to encode to an invalid Connection.\n"
|
[NSException
|
||||||
"You should request ConnectionBecameInvalidNotification's and\n"
|
raise: NSGenericException
|
||||||
"remove all references to the Proxy's of invalid Connections."];
|
format: @"Trying to encode to an invalid Connection.\n"
|
||||||
|
@"You should request ConnectionBecameInvalidNotification's and\n"
|
||||||
|
@"remove all references to the Proxy's of invalid Connections."];
|
||||||
|
|
||||||
/* Find out if anObject is a proxy or not. */
|
/* Find out if anObject is a proxy or not. */
|
||||||
if (class_is_kind_of (object_get_class (anObject), self))
|
if (class_is_kind_of (object_get_class (anObject), self))
|
||||||
|
@ -264,7 +268,9 @@ enum
|
||||||
id decoder_connection;
|
id decoder_connection;
|
||||||
|
|
||||||
if ([aRmc class] != [ConnectedDecoder class])
|
if ([aRmc class] != [ConnectedDecoder class])
|
||||||
[self error:"Proxy objects only decode with ConnectedDecoder class"];
|
[NSException
|
||||||
|
raise: NSGenericException
|
||||||
|
format: @"Proxy objects only decode with ConnectedDecoder class"];
|
||||||
|
|
||||||
decoder_connection = [aRmc connection];
|
decoder_connection = [aRmc connection];
|
||||||
assert (decoder_connection);
|
assert (decoder_connection);
|
||||||
|
@ -433,9 +439,11 @@ enum
|
||||||
if (debug_proxy)
|
if (debug_proxy)
|
||||||
printf("Proxy forwarding %s\n", sel_get_name(aSel));
|
printf("Proxy forwarding %s\n", sel_get_name(aSel));
|
||||||
if (![_connection isValid])
|
if (![_connection isValid])
|
||||||
[self error: "Trying to send message to an invalid Proxy.\n"
|
[NSException
|
||||||
"You should request ConnectionBecameInvalidNotification's and\n"
|
raise: NSGenericException
|
||||||
"remove all references to the Proxy's of invalid Connections."];
|
format: @"Trying to send message to an invalid Proxy.\n"
|
||||||
|
@"You should request ConnectionBecameInvalidNotification's and\n"
|
||||||
|
@"remove all references to the Proxy's of invalid Connections."];
|
||||||
return [_connection forwardForProxy: self
|
return [_connection forwardForProxy: self
|
||||||
selector: aSel
|
selector: aSel
|
||||||
argFrame: frame];
|
argFrame: frame];
|
||||||
|
|
Loading…
Reference in a new issue