Adding errors to be handled. Organizing error handling.
[mkjsf-moved-to-github.git] / src / main / java / com / indexdata / pz2utils4jsf / pazpar2 / Pz2Session.java
index 3034a74..267f1b4 100644 (file)
@@ -18,6 +18,7 @@ import com.indexdata.masterkey.pazpar2.client.Pazpar2ClientGeneric;
 import com.indexdata.masterkey.pazpar2.client.exceptions.ProxyErrorException;\r
 import com.indexdata.pz2utils4jsf.config.Pz2Configurator;\r
 import com.indexdata.pz2utils4jsf.controls.ResultsPager;\r
+import com.indexdata.pz2utils4jsf.errors.ConfigurationException;\r
 import com.indexdata.pz2utils4jsf.errors.ErrorInterface;\r
 import com.indexdata.pz2utils4jsf.errors.ErrorHelper;\r
 import com.indexdata.pz2utils4jsf.errors.ConfigurationError;\r
@@ -64,7 +65,7 @@ public class Pz2Session implements Pz2Interface {
       } catch (ProxyErrorException pe) {\r
         logger.error("Could not configure Pazpar2 client: " + pe.getMessage());\r
         configurationErrors.add(new ConfigurationError("Pz2Client Config","ProxyError","Could not configure Pazpar2 client: " + pe.getMessage(),errorHelper));\r
-      } catch (IOException io) {\r
+      } catch (ConfigurationException io) {\r
         logger.error("Could not configure Pazpar2 client: " + io.getMessage());\r
         configurationErrors.add(new ConfigurationError("Pz2Client Config","ProxyError","Could not configure Pazpar2 client: " + io.getMessage(),errorHelper));\r
       }\r
@@ -75,7 +76,7 @@ public class Pz2Session implements Pz2Interface {
           logger.error("Could not instantiate Pazpar2 client: " + pe.getMessage());\r
           configurationErrors.add(new ConfigurationError("Pz2Client error","ProxyError","Could not create Pazpar2 client: " +pe.getMessage(),errorHelper));                \r
         } \r
-        logger.info("Got " + configurationErrors.size() + " configuration errors");        \r
+        logger.info("Found " + configurationErrors.size() + " configuration errors");        \r
       }\r
       resetDataObjects();\r
     } else {\r