mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Make exceptions a bit more informative.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19460 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f554633dce
commit
a4b37594c5
2 changed files with 20 additions and 5 deletions
|
@ -1,3 +1,7 @@
|
|||
2004-06-05 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSDictionary.m: Make exceptions a little more informative.
|
||||
|
||||
2004-06-03 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* Source/Additions/GSObjCRuntime.m (BDBGPrintf) New macro.
|
||||
|
|
|
@ -377,13 +377,24 @@ static SEL objSel;
|
|||
|
||||
if (aKey == nil)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Tried to add nil key to dictionary"];
|
||||
NSException *e;
|
||||
|
||||
e = [NSException exceptionWithName: NSInvalidArgumentException
|
||||
reason: @"Tried to add nil key to dictionary"
|
||||
userInfo: self];
|
||||
[e raise];
|
||||
}
|
||||
if (anObject == nil)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Tried to add nil value to dictionary"];
|
||||
NSException *e;
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat:
|
||||
@"Tried to add nil value for key '%@' to dictionary", aKey];
|
||||
e = [NSException exceptionWithName: NSInvalidArgumentException
|
||||
reason: s
|
||||
userInfo: self];
|
||||
[e raise];
|
||||
}
|
||||
node = GSIMapNodeForKey(&map, (GSIMapKey)aKey);
|
||||
if (node)
|
||||
|
@ -407,7 +418,7 @@ static SEL objSel;
|
|||
{
|
||||
if (aKey == nil)
|
||||
{
|
||||
NSWarnMLog(@"attempt to remove nil key");
|
||||
NSWarnMLog(@"attempt to remove nil key from dictionary %@", self);
|
||||
return;
|
||||
}
|
||||
GSIMapRemoveKey(&map, (GSIMapKey)aKey);
|
||||
|
|
Loading…
Reference in a new issue