dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #38497
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19612: ADX catch exception
------------------------------------------------------------
revno: 19612
committer: Bob Jolliffe <bobjolliffe@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-07-10 10:04:07 +0100
message:
ADX catch exception
modified:
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/adx/DefaultADXDataService.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/adx/DefaultADXDataService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/adx/DefaultADXDataService.java 2015-07-08 16:19:15 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/adx/DefaultADXDataService.java 2015-07-10 09:04:07 +0000
@@ -289,7 +289,11 @@
IdentifiableProperty dataElementIdScheme = importOptions.getDataElementIdScheme();
DataElement dataElement = identifiableObjectManager.getObject( DataElement.class, dataElementIdScheme,dvAttributes.get( ADXConstants.DATAELEMENT));
-
+
+ if (dataElement == null)
+ {
+ throw new ADXException(dvAttributes.get( ADXConstants.DATAELEMENT), "No matching dataelement");
+ }
// process adx datavalue attributes
if ( !dvAttributes.containsKey( ADXConstants.CATOPTCOMBO ) )
{
@@ -309,7 +313,7 @@
}
else
{
- throw new ADXException( "Dataelement " + dataElement.getShortName() + " expects text annotation" );
+ throw new ADXException( dvAttributes.get( ADXConstants.DATAELEMENT),"Dataelement expects text annotation" );
}
}