Author: torehalset
Date: Wed Oct 25 15:47:44 2006
New Revision: 467802
URL: http://svn.apache.org/viewvc?view=rev&rev=467802
Log:
display commit error
Modified:
incubator/cayenne/sandbox/CocoaCayenne/CAYClient/AppController.m
Modified: incubator/cayenne/sandbox/CocoaCayenne/CAYClient/AppController.m
URL:
http://svn.apache.org/viewvc/incubator/cayenne/sandbox/CocoaCayenne/CAYClient/AppController.m?view=diff&rev=467802&r1=467801&r2=467802
==============================================================================
--- incubator/cayenne/sandbox/CocoaCayenne/CAYClient/AppController.m (original)
+++ incubator/cayenne/sandbox/CocoaCayenne/CAYClient/AppController.m Wed Oct 25
15:47:44 2006
@@ -35,7 +35,16 @@
- (IBAction)commit:(id)sender
{
- [[self objectContext] commitChanges];
+ NSError *error = nil;
+ BOOL ok = [[self objectContext] commitChanges:&error];
+ if(!ok)
+ {
+ NSLog(@"Error in commitChanges: %@", [error localizedDescription]);
+ [NSApp presentError:error modalForWindow:[NSApp keyWindow]
+ delegate:self
+ didPresentSelector:@selector(commit:)
+ contextInfo:nil];
+ }
}
- (IBAction)query:(id)sender