Permalink
Browse files

Improved error message.

  • Loading branch information...
1 parent 50b43e4 commit d836de0b6f8cd97b4551b67ce5d7afa29ebb9ab1 @erikdoe committed Jul 31, 2012
Showing with 2 additions and 3 deletions.
  1. +1 −2 .gitignore
  2. +1 −1 Source/OCMock/OCMBoxedReturnValueProvider.m
View
@@ -1,5 +1,4 @@
.DS_Store
xcuserdata
*.xcworkspace
-
-
+.idea
@@ -11,7 +11,7 @@ @implementation OCMBoxedReturnValueProvider
- (void)handleInvocation:(NSInvocation *)anInvocation
{
if(strcmp([[anInvocation methodSignature] methodReturnType], [(NSValue *)returnValue objCType]) != 0)
- @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"Return value does not match method signature." userInfo:nil];
+ @throw [NSException exceptionWithName:NSInvalidArgumentException reason:[NSString stringWithFormat:@"Return value does not match method signature; signature declares '%s' but value is '%s'.", [[anInvocation methodSignature] methodReturnType], [(NSValue *)returnValue objCType]] userInfo:nil];
void *buffer = malloc([[anInvocation methodSignature] methodReturnLength]);
[returnValue getValue:buffer];
[anInvocation setReturnValue:buffer];

0 comments on commit d836de0

Please sign in to comment.