From c8b7d2d1d18a180ca45b2a7e1db02c317d16c877 Mon Sep 17 00:00:00 2001 From: nimakarimipour Date: Tue, 25 Jan 2022 16:35:46 -0800 Subject: [PATCH] Refined exception causes --- .../nullaway/fixserialization/FixSerializationConfig.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nullaway/src/main/java/com/uber/nullaway/fixserialization/FixSerializationConfig.java b/nullaway/src/main/java/com/uber/nullaway/fixserialization/FixSerializationConfig.java index aabe1bb9ac..4181770626 100644 --- a/nullaway/src/main/java/com/uber/nullaway/fixserialization/FixSerializationConfig.java +++ b/nullaway/src/main/java/com/uber/nullaway/fixserialization/FixSerializationConfig.java @@ -24,11 +24,14 @@ import com.google.common.base.Preconditions; import com.uber.nullaway.fixserialization.qual.AnnotationConfig; +import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; +import org.xml.sax.SAXException; /** Config class for Fix Serialization package. */ public class FixSerializationConfig { @@ -89,7 +92,7 @@ public FixSerializationConfig(String configFilePath) { DocumentBuilder builder = factory.newDocumentBuilder(); document = builder.parse(Files.newInputStream(Paths.get(configFilePath))); document.normalize(); - } catch (Exception e) { + } catch (IOException | SAXException | ParserConfigurationException e) { throw new RuntimeException( "Error in reading/parsing config at path: " + configFilePath + "\n" + e); }