Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Do not try to load molecule property again if it fails returns NA ins…
…tead

Exceptions are logged as debug messages.
Solves bug 3239
  • Loading branch information
goglepox committed Aug 21, 2012
1 parent 68639b7 commit e3ecd69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
Expand Up @@ -146,22 +146,12 @@ public synchronized ICDKMolecule getMoleculeAt( int index ) {
mol = new CDKMolecule((IAtomContainer)chemObj);
setLastRead( index, mol );
readProperties( mol );
} catch ( CoreException e ) {
} catch ( Throwable e ) {
logger.warn( "Failed to read record "+index);
LogUtils.debugTrace( logger, e );
setLastRead( index, null );
return null;
} catch ( IOException e ) {
logger.warn( "Failed to read record "+index);
LogUtils.debugTrace( logger, e );
setLastRead( index, null );
return null;
} catch ( CDKException e ) {
logger.warn( "Failed to read record "+index);
LogUtils.debugTrace( logger, e );
setLastRead( index, null );
return null;
}
}
}

sanatizeMDLV2000MolFileInput(mol);
Expand Down
Expand Up @@ -46,7 +46,7 @@ public static String createPropertyKey(String propertyName, int row) {
public Object call() throws Exception {

ICDKMolecule molecule = model.getMoleculeAt( row );

if(molecule==null) return "NA";
if(propertyName == null) return calculateCoordinates( molecule );

Object property = molecule.getProperty( propertyName, Property.USE_CACHED );
Expand Down

0 comments on commit e3ecd69

Please sign in to comment.