You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by to...@apache.org on 2006/10/26 00:47:44 UTC

svn commit: r467802 - /incubator/cayenne/sandbox/CocoaCayenne/CAYClient/AppController.m

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