Skip to content

Commit 15e1556

Browse files
committed
Suppress JenaException raised when the initialization thread is cancelled
1 parent 37bd9da commit 15e1556

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/ubic/basecode/ontology/providers/AbstractOntologyService.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121

2222
import com.hp.hpl.jena.ontology.OntModel;
2323
import com.hp.hpl.jena.ontology.OntModelSpec;
24+
import com.hp.hpl.jena.rdf.arp.ARPErrorNumbers;
25+
import com.hp.hpl.jena.rdf.arp.ParseException;
26+
import com.hp.hpl.jena.shared.JenaException;
2427
import org.apache.commons.lang3.RandomStringUtils;
2528
import org.apache.commons.lang3.StringUtils;
2629
import org.apache.commons.lang3.time.StopWatch;
@@ -368,6 +371,10 @@ public synchronized void startInitializationThread( boolean forceLoad, boolean f
368371
initializationThread = new Thread( () -> {
369372
try {
370373
this.initialize( forceLoad, forceIndexing );
374+
} catch ( JenaException e ) {
375+
if ( !( e.getCause() instanceof ParseException ) || ( ( ParseException ) e.getCause() ).getErrorNumber() != ARPErrorNumbers.ERR_INTERRUPTED ) {
376+
throw e;
377+
}
371378
} catch ( Exception e ) {
372379
log.error( e.getMessage(), e );
373380
this.isInitialized = false;

0 commit comments

Comments
 (0)