Return-Path: X-Original-To: apmail-lucene-commits-archive@www.apache.org Delivered-To: apmail-lucene-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2FCF810B19 for ; Sat, 22 Mar 2014 19:36:47 +0000 (UTC) Received: (qmail 41541 invoked by uid 500); 22 Mar 2014 19:36:46 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 41529 invoked by uid 99); 22 Mar 2014 19:36:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Mar 2014 19:36:46 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Mar 2014 19:36:44 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A8CA62388906; Sat, 22 Mar 2014 19:36:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1580295 - in /lucene/dev/branches/branch_4x: ./ solr/ solr/core/ solr/core/src/java/org/apache/solr/handler/SnapPuller.java Date: Sat, 22 Mar 2014 19:36:22 -0000 To: commits@lucene.apache.org From: shalin@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140322193622.A8CA62388906@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: shalin Date: Sat Mar 22 19:36:22 2014 New Revision: 1580295 URL: http://svn.apache.org/r1580295 Log: Merging r1580294 from trunk - Don't swallow exception in getLatestVersion. Refactored some odd if conditions. Modified: lucene/dev/branches/branch_4x/ (props changed) lucene/dev/branches/branch_4x/solr/ (props changed) lucene/dev/branches/branch_4x/solr/core/ (props changed) lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/SnapPuller.java Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/SnapPuller.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/SnapPuller.java?rev=1580295&r1=1580294&r2=1580295&view=diff ============================================================================== --- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/SnapPuller.java (original) +++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/SnapPuller.java Sat Mar 22 19:36:22 2014 @@ -251,7 +251,7 @@ public class SnapPuller { rsp = server.request(req); } catch (SolrServerException e) { - throw new SolrException(ErrorCode.SERVER_ERROR, e.getMessage()); + throw new SolrException(ErrorCode.SERVER_ERROR, e.getMessage(), e); } finally { server.shutdown(); } @@ -883,9 +883,8 @@ public class SnapPuller { File oldFile = new File(confDir, file.getPath().substring(tmpconfDir.getPath().length(), file.getPath().length())); if (!oldFile.getParentFile().exists()) { status = oldFile.getParentFile().mkdirs(); - if (status) { - } else { - throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, + if (!status) { + throw new SolrException(ErrorCode.SERVER_ERROR, "Unable to mkdirs: " + oldFile.getParentFile()); } } @@ -893,9 +892,8 @@ public class SnapPuller { File backupFile = new File(oldFile.getPath() + "." + getDateAsStr(new Date(oldFile.lastModified()))); if (!backupFile.getParentFile().exists()) { status = backupFile.getParentFile().mkdirs(); - if (status) { - } else { - throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, + if (!status) { + throw new SolrException(ErrorCode.SERVER_ERROR, "Unable to mkdirs: " + backupFile.getParentFile()); } } @@ -906,9 +904,8 @@ public class SnapPuller { } } status = file.renameTo(oldFile); - if (status) { - } else { - throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, + if (!status) { + throw new SolrException(ErrorCode.SERVER_ERROR, "Unable to rename: " + file + " to: " + oldFile); } }