Re-throwing handled exception as configuration exceptions
This commit is contained in:
@@ -7,6 +7,7 @@ import java.util.Properties;
|
|||||||
import javax.persistence.EntityManagerFactory;
|
import javax.persistence.EntityManagerFactory;
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import ca.uhn.fhir.context.ConfigurationException;
|
||||||
import ca.uhn.fhir.jpa.search.DatabaseBackedPagingProvider;
|
import ca.uhn.fhir.jpa.search.DatabaseBackedPagingProvider;
|
||||||
import ca.uhn.fhir.jpa.search.LuceneSearchMappingFactory;
|
import ca.uhn.fhir.jpa.search.LuceneSearchMappingFactory;
|
||||||
import ca.uhn.fhir.jpa.util.DerbyTenSevenHapiFhirDialect;
|
import ca.uhn.fhir.jpa.util.DerbyTenSevenHapiFhirDialect;
|
||||||
@@ -82,16 +83,8 @@ public class FhirServerConfig extends BaseJavaConfigDstu3 {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
retVal.setDataSource(dataSource());
|
retVal.setDataSource(dataSource());
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
throw new ConfigurationException("Could not set the data source due to a configuration issue", e);
|
||||||
} catch (NoSuchMethodException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (InvocationTargetException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (InstantiationException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
retVal.setJpaProperties(jpaProperties());
|
retVal.setJpaProperties(jpaProperties());
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package ca.uhn.fhir.jpa.demo;
|
package ca.uhn.fhir.jpa.demo;
|
||||||
|
|
||||||
|
import ca.uhn.fhir.context.ConfigurationException;
|
||||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||||
import ca.uhn.fhir.rest.api.EncodingEnum;
|
import ca.uhn.fhir.rest.api.EncodingEnum;
|
||||||
import ca.uhn.fhir.rest.server.ETagSupportEnum;
|
import ca.uhn.fhir.rest.server.ETagSupportEnum;
|
||||||
@@ -45,10 +46,8 @@ public class HapiProperties {
|
|||||||
HapiProperties.properties = new Properties();
|
HapiProperties.properties = new Properties();
|
||||||
HapiProperties.properties.load(in);
|
HapiProperties.properties.load(in);
|
||||||
in.close();
|
in.close();
|
||||||
} catch (FileNotFoundException e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
throw new ConfigurationException("Could not load HAPI properties", e);
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user