mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
(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:
parent
e307153bb8
commit
09145d33ab
1 changed files with 17 additions and 0 deletions
|
@ -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]];
|
||||
|
||||
|
|
Loading…
Reference in a new issue