(main): Add a call that causes an exception in the server, and catch

the returned exception.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1281 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mccallum 1996-03-27 01:29:45 +00:00
parent e307153bb8
commit 09145d33ab

View file

@ -4,6 +4,7 @@
#include <objects/Invocation.h>
#include <objects/RunLoop.h>
#include <Foundation/NSDate.h>
#include <Foundation/NSException.h>
id announce_new_connection (id notification)
{
@ -65,6 +66,22 @@ int main(int argc, char *argv[])
}
}
/* Cause an exception, and watch it return to us. */
NS_DURING
{
id o = [remote_array objectAtIndex: 99];
}
NS_HANDLER
{
printf("Caught our exception\n"
"NAME: %@\n"
"REASON: %@\n",
[exception name],
[exception reason]);
[exception release];
}
NS_ENDHANDLER
/* Run, exiting as soon as there are 30 minutes with no requests */
[RunLoop runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 30 * 60]];