From 5b71d4680b058f7ea310ee878df2435e3bc70703 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Fri, 10 Nov 2006 21:29:50 +0000 Subject: Improve exception message. --- .../java/com/amazon/carbonado/OptimisticLockException.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/amazon/carbonado/OptimisticLockException.java b/src/main/java/com/amazon/carbonado/OptimisticLockException.java index b4a43de..949537e 100644 --- a/src/main/java/com/amazon/carbonado/OptimisticLockException.java +++ b/src/main/java/com/amazon/carbonado/OptimisticLockException.java @@ -72,16 +72,10 @@ public class OptimisticLockException extends PersistException { } private static String makeMessage(Object expectedVersion, Object savedVersion) { - if (expectedVersion == null) { - if (savedVersion == null) { - return null; - } - return "Failed to update because saved version is " + savedVersion; + if (expectedVersion == null && savedVersion == null) { + return null; } - if (savedVersion == null) { - return "Failed to update for expected version " + expectedVersion; - } - return "Failed to update for expected version " + expectedVersion + - " because saved version is " + savedVersion; + return "Update acted on version " + expectedVersion + + ", but canonical version is " + savedVersion; } } -- cgit v1.2.3