@@ -297,12 +297,19 @@ protected CloseableIteration<? extends Namespace> getNamespacesInternal() throws
297297 protected CloseableIteration <? extends Statement > getStatementsInternal (Resource subj , IRI pred ,
298298 Value obj , boolean includeInferred , Resource ... contexts ) throws SailException {
299299
300- Dataset dataset = new SimpleDataset ();
301- FederationEvaluationStrategy strategy = federationContext .createStrategy (dataset );
302- QueryInfo queryInfo = new QueryInfo (subj , pred , obj , 0 , includeInferred , federationContext , strategy ,
303- dataset );
304- federationContext .getMonitoringService ().monitorQuery (queryInfo );
305- return strategy .getStatements (queryInfo , subj , pred , obj , contexts );
300+ try {
301+ Dataset dataset = new SimpleDataset ();
302+ FederationEvaluationStrategy strategy = federationContext .createStrategy (dataset );
303+ QueryInfo queryInfo = new QueryInfo (subj , pred , obj , 0 , includeInferred , federationContext , strategy ,
304+ dataset );
305+ federationContext .getMonitoringService ().monitorQuery (queryInfo );
306+ return strategy .getStatements (queryInfo , subj , pred , obj , contexts );
307+ } catch (Exception e ) {
308+ if (e instanceof SailException se ) {
309+ throw se ;
310+ }
311+ throw new SailException (e );
312+ }
306313 }
307314
308315 @ Override
@@ -316,9 +323,10 @@ protected boolean hasStatementInternal(Resource subj, IRI pred, Value obj, boole
316323 federationContext .getMonitoringService ().monitorQuery (queryInfo );
317324 return strategy .hasStatements (queryInfo , subj , pred , obj , contexts );
318325
319- } catch (RuntimeException e ) {
320- throw e ;
321326 } catch (Exception e ) {
327+ if (e instanceof SailException se ) {
328+ throw se ;
329+ }
322330 if (e instanceof InterruptedException ) {
323331 Thread .currentThread ().interrupt ();
324332 }
@@ -330,7 +338,10 @@ protected boolean hasStatementInternal(Resource subj, IRI pred, Value obj, boole
330338 protected void addStatementInternal (Resource subj , IRI pred , Value obj , Resource ... contexts ) throws SailException {
331339 try {
332340 getWriteStrategyInternal ().addStatement (subj , pred , obj , contexts );
333- } catch (RepositoryException e ) {
341+ } catch (Exception e ) {
342+ if (e instanceof SailException se ) {
343+ throw se ;
344+ }
334345 throw new SailException (e );
335346 }
336347 }
0 commit comments