diff --git a/ChangeLog b/ChangeLog index f3506c6ff..ed00f80ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-03-17 Richard Frith-Macdonald + + * Source/NSPort.m: + * Source/NSException.m: + * Source/NSConnection.m: + * Headers/Foundation/NSException.h: + * Headers/Foundation/NSPort.h: + Update exceptions to match those in MacOS-X for compatibility. + 2008-03-16 Matt Rice * Source/NSException.m: Add NSObjectNotAvailableException. diff --git a/Headers/Foundation/NSException.h b/Headers/Foundation/NSException.h index 35f296c6e..a542ea723 100644 --- a/Headers/Foundation/NSException.h +++ b/Headers/Foundation/NSException.h @@ -161,53 +161,79 @@ extern "C" { @end -/** - * A generic exception for general purpose usage. +/** An exception when character set conversion fails. + */ +GS_EXPORT NSString* const NSCharacterConversionException; + +/** Attempt to use an invalidated destination. + */ +GS_EXPORT NSString* const NSDestinationInvalidException; + +/** A generic exception for general purpose usage. */ GS_EXPORT NSString* const NSGenericException; -/** - * An exception for cases where unexpected state is detected within an object. +/** An exception for cases where unexpected state is detected within an object. */ GS_EXPORT NSString* const NSInternalInconsistencyException; -/** - * An exception used when an invalid argument is passed to a method +/** An exception used when an invalid argument is passed to a method * or function. */ GS_EXPORT NSString* const NSInvalidArgumentException; -/** - * An exception used when the system fails to allocate required memory. +/** Attempt to use a receive port which has been invalidated. + */ +GS_EXPORT NSString * const NSInvalidReceivePortException; + +/** Attempt to use a send port which has been invalidated. + */ +GS_EXPORT NSString * const NSInvalidSendPortException; + +/** An exception used when the system fails to allocate required memory. */ GS_EXPORT NSString* const NSMallocException; -/** - * An exception used when an illegal range is encountered ... usually this - * is used to provide more information than an invalid argument exception. - */ -GS_EXPORT NSString* const NSRangeException; - -/** - * An exception when character set conversion fails. - */ -GS_EXPORT NSString* const NSCharacterConversionException; - -/** - * An exception when a remote object is sent a message from a thread +/** An exception when a remote object is sent a message from a thread * unable to access the object. */ GS_EXPORT NSString* const NSObjectInaccessibleException; +/** Attempt to send to an object which is no longer available. + */ GS_EXPORT NSString* const NSObjectNotAvailableException; +/** UNused ... for MacOS-X compatibility. + */ +GS_EXPORT NSString* const NSOldStyleException; + #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) -/** - * An exception used when some form of parsing fails. +/** An exception used when some form of parsing fails. */ GS_EXPORT NSString* const NSParseErrorException; #endif +/** Some failure to receive on a port. + */ +GS_EXPORT NSString * const NSPortReceiveException; + +/** Some failure to send on a port. + */ +GS_EXPORT NSString * const NSPortSendException; + +/** + * Exception raised by [NSPort], [NSConnection], and friends if sufficient + * time elapses while waiting for a response, or if the receiving port is + * invalidated before a request can be received. See + * [NSConnection-setReplyTimeout:]. + */ +GS_EXPORT NSString * const NSPortTimeoutException; /* OPENSTEP */ + +/** An exception used when an illegal range is encountered ... usually this + * is used to provide more information than an invalid argument exception. + */ +GS_EXPORT NSString* const NSRangeException; + /** * The actual structure for an NSHandler. You shouldn't need to worry about it. */ diff --git a/Headers/Foundation/NSPort.h b/Headers/Foundation/NSPort.h index f360cf1ef..873e2fe9c 100644 --- a/Headers/Foundation/NSPort.h +++ b/Headers/Foundation/NSPort.h @@ -61,14 +61,6 @@ extern "C" { - (void) handlePortMessage: (NSPortMessage*)aMessage; @end -/** - * Exception raised by [NSPort], [NSConnection], and friends if sufficient - * time elapses while waiting for a response, or if the receiving port is - * invalidated before a request can be received. See - * [NSConnection-setReplyTimeout:]. - */ -GS_EXPORT NSString * const NSPortTimeoutException; /* OPENSTEP */ - /** *

NSPort is an abstract class defining interfaces underlying * communications in the distributed objects framework. Each side of a diff --git a/Source/NSConnection.m b/Source/NSConnection.m index eeaaa666c..e665c94d6 100644 --- a/Source/NSConnection.m +++ b/Source/NSConnection.m @@ -109,6 +109,8 @@ extern NSRunLoop *GSRunLoopForThread(NSThread*); #define M_LOCK(X) {NSDebugMLLog(@"GSConnection",@"Lock %@",X);[X lock];} #define M_UNLOCK(X) {NSDebugMLLog(@"GSConnection",@"Unlock %@",X);[X unlock];} +NSString * const NSDestinationInvalidException = + @"NSDestinationInvalidException"; NSString * const NSFailedAuthenticationException = @"NSFailedAuthenticationExceptions"; NSString * const NSObjectInaccessibleException = diff --git a/Source/NSException.m b/Source/NSException.m index a5a7c3f2f..208132af2 100644 --- a/Source/NSException.m +++ b/Source/NSException.m @@ -656,6 +656,9 @@ GSListModules() @end +NSString* const NSCharacterConversionException + = @"NSCharacterConversionException"; + NSString* const NSGenericException = @"NSGenericException"; @@ -668,15 +671,15 @@ NSString* const NSInvalidArgumentException NSString* const NSMallocException = @"NSMallocException"; -NSString* const NSRangeException - = @"NSRangeException"; - -NSString* const NSCharacterConversionException - = @"NSCharacterConversionException"; +NSString* const NSOldStyleException + = @"NSOldStyleException"; NSString* const NSParseErrorException = @"NSParseErrorException"; +NSString* const NSRangeException + = @"NSRangeException"; + static void _terminate() { BOOL shouldAbort; diff --git a/Source/NSPort.m b/Source/NSPort.m index 48f628e3a..5eb229fee 100644 --- a/Source/NSPort.m +++ b/Source/NSPort.m @@ -49,11 +49,16 @@ @implementation NSPort -/** - * Exception raised if a timeout occurs during a port send or receive - * operation. - */ -NSString * const NSPortTimeoutException = @"NSPortTimeoutException"; +NSString * const NSInvalidReceivePortException + = @"NSInvalidReceivePortException"; +NSString * const NSInvalidSendPortException + = @"NSInvalidSendPortException"; +NSString * const NSPortReceiveException + = @"NSPortReceiveException"; +NSString * const NSPortSendException + = @"NSPortSendException"; +NSString * const NSPortTimeoutException + = @"NSPortTimeoutException"; static Class NSPort_abstract_class; static Class NSPort_concrete_class;