From: Anjo K. <an...@us...> - 2006-06-30 20:19:35
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERDirectToWeb/Sources/er/directtoweb In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19578/ERDirectToWeb/Sources/er/directtoweb Modified Files: ERDDeletionDelegate.java Log Message: NPE prevention when parsing DB error userInfo Index: ERDDeletionDelegate.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERDirectToWeb/Sources/er/directtoweb/ERDDeletionDelegate.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ERDDeletionDelegate.java 13 May 2006 19:24:45 -0000 1.10 --- ERDDeletionDelegate.java 30 Jun 2006 20:19:15 -0000 1.11 *************** *** 76,86 **** exception = ERXValidationFactory.defaultFactory().createCustomException(_object, "EOObjectNotAvailableException"); } catch (EOGeneralAdaptorException e) { ! EODatabaseOperation op = (EODatabaseOperation)e.userInfo().objectForKey( ! EODatabaseContext.FailedDatabaseOperationKey); ! if(op.databaseOperator() == EODatabaseOperation.DatabaseDeleteOperator) { ! exception = ERXValidationFactory.defaultFactory().createCustomException(_object, "EOObjectNotAvailableException"); ! } else { ! exception = ERXValidationFactory.defaultFactory().createCustomException(_object, "Database error: " + e.getMessage()); ! } } catch (NSValidation.ValidationException e) { exception = e; --- 76,89 ---- exception = ERXValidationFactory.defaultFactory().createCustomException(_object, "EOObjectNotAvailableException"); } catch (EOGeneralAdaptorException e) { ! NSDictionary userInfo = e.userInfo(); ! if(userInfo != null) { ! EODatabaseOperation op = (EODatabaseOperation)userInfo.objectForKey(EODatabaseContext.FailedDatabaseOperationKey); ! if(op.databaseOperator() == EODatabaseOperation.DatabaseDeleteOperator) { ! exception = ERXValidationFactory.defaultFactory().createCustomException(_object, "EOObjectNotAvailableException"); ! } ! } ! if(exception == null) { ! exception = ERXValidationFactory.defaultFactory().createCustomException(_object, "Database error: " + e.getMessage()); ! } } catch (NSValidation.ValidationException e) { exception = e; |