From 9cb69be3805192049d9d79e737ee35fd8b8012a9 Mon Sep 17 00:00:00 2001 From: Shalin Shekhar Mangar Date: Wed, 5 Feb 2014 10:25:47 +0000 Subject: [PATCH] SOLR-5623: Use root locale in String.format and do not wrap SolrExceptions git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1564700 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/solr/update/DirectUpdateHandler2.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java b/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java index e0f469de4d1..864dc83b65c 100644 --- a/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java +++ b/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java @@ -57,6 +57,7 @@ import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; @@ -157,9 +158,11 @@ public class DirectUpdateHandler2 extends UpdateHandler implements SolrCoreState public int addDoc(AddUpdateCommand cmd) throws IOException { try { return addDoc0(cmd); - } catch (RuntimeException t) { - - throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, String.format("Exception writing document id %s to the index; possible analysis error.", + } catch (SolrException e) { + throw e; + } catch (RuntimeException t) { + throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, + String.format(Locale.ROOT, "Exception writing document id %s to the index; possible analysis error.", cmd.getPrintableId()), t); } }