You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by pk...@apache.org on 2022/03/30 21:37:51 UTC
[logging-log4j2] 01/15: Merge catch clauses.
This is an automated email from the ASF dual-hosted git repository.
pkarwasz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit 3e88da0c9e0e381af35ad06c2ffd7216598ea9e9
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Feb 19 11:52:57 2022 -0500
Merge catch clauses.
---
.../main/java/org/apache/log4j/xml/XmlConfiguration.java | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/xml/XmlConfiguration.java b/log4j-1.2-api/src/main/java/org/apache/log4j/xml/XmlConfiguration.java
index 1b05d57..58195c4 100644
--- a/log4j-1.2-api/src/main/java/org/apache/log4j/xml/XmlConfiguration.java
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/xml/XmlConfiguration.java
@@ -649,17 +649,15 @@ public class XmlConfiguration extends Log4j1Configuration {
propSetter.activate();
return layout;
- } catch (ConsumerException ce) {
- Throwable cause = ce.getCause();
- if (cause instanceof InterruptedException || cause instanceof InterruptedIOException) {
- Thread.currentThread().interrupt();
- }
- LOGGER.error("Could not create the Layout. Reported error follows.", cause);
- } catch (Exception oops) {
- if (oops instanceof InterruptedException || oops instanceof InterruptedIOException) {
+ } catch (Exception e) {
+ Throwable cause = e.getCause();
+ if (e instanceof InterruptedException
+ || e instanceof InterruptedIOException
+ || cause instanceof InterruptedException
+ || cause instanceof InterruptedIOException) {
Thread.currentThread().interrupt();
}
- LOGGER.error("Could not create the Layout. Reported error follows.", oops);
+ LOGGER.error("Could not create the Layout. Reported error follows.", e);
}
return null;
}