mirror of https://github.com/apache/lucene.git
SOLR-9428: Improve logging to log root cause
This commit is contained in:
parent
c164d7f2b2
commit
364a29c0ab
|
@ -84,7 +84,7 @@ public abstract class ManagedResourceStorage {
|
|||
* whether the core is running in cloud mode as well as initArgs.
|
||||
*/
|
||||
public static StorageIO newStorageIO(String collection, SolrResourceLoader resourceLoader, NamedList<String> initArgs) {
|
||||
StorageIO storageIO = null;
|
||||
StorageIO storageIO;
|
||||
|
||||
SolrZkClient zkClient = null;
|
||||
String zkConfigName = null;
|
||||
|
@ -94,9 +94,10 @@ public abstract class ManagedResourceStorage {
|
|||
zkConfigName = ((ZkSolrResourceLoader)resourceLoader).getZkController().
|
||||
getZkStateReader().readConfigName(collection);
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to get config name for collection {} due to: {}",
|
||||
collection, e.toString());
|
||||
}
|
||||
log.error("Failed to get config name due to", e);
|
||||
throw new SolrException(ErrorCode.SERVER_ERROR,
|
||||
"Failed to load config name for collection:" + collection + " due to: ", e);
|
||||
}
|
||||
if (zkConfigName == null) {
|
||||
throw new SolrException(ErrorCode.SERVER_ERROR,
|
||||
"Could not find config name for collection:" + collection);
|
||||
|
|
|
@ -192,10 +192,8 @@ public class ZkStateReader implements Closeable {
|
|||
} else {
|
||||
throw new ZooKeeperException(ErrorCode.INVALID_STATE, "No config data found at path: " + path);
|
||||
}
|
||||
} catch (KeeperException e) {
|
||||
throw new SolrException(ErrorCode.SERVER_ERROR, "Error loading config name for collection " + collection, e);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
} catch (KeeperException| InterruptedException e) {
|
||||
SolrZkClient.checkInterrupted(e);
|
||||
throw new SolrException(ErrorCode.SERVER_ERROR, "Error loading config name for collection " + collection, e);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue