@@ -163,40 +163,45 @@ public GraphDimensions estimationDimensions() {
163
163
public CSRGraphStore build () {
164
164
// Temporarily override the security context to enforce read-only access during load
165
165
return readOnlyTransaction ().apply ((tx , ktx ) -> {
166
- BatchLoadResult nodeCount = new CountingCypherRecordLoader (
167
- cypherConfig .nodeQuery (),
168
- CypherRecordLoader .QueryType .NODE ,
169
- cypherConfig ,
170
- loadingContext
171
- ).load (ktx .internalTransaction ());
172
-
173
- progressTracker .beginSubTask ("Loading" );
174
- var nodes = new CypherNodeLoader (
175
- cypherConfig .nodeQuery (),
176
- nodeCount .rows (),
177
- cypherConfig ,
178
- loadingContext ,
179
- progressTracker
180
- ).load (ktx .internalTransaction ());
181
-
182
- var relationshipImportResult = new CypherRelationshipLoader (
183
- cypherConfig .relationshipQuery (),
184
- nodes .idMap (),
185
- cypherConfig ,
186
- loadingContext ,
187
- progressTracker
188
- ).load (ktx .internalTransaction ());
189
-
190
- var graphStore = createGraphStore (
191
- nodes ,
192
- relationshipImportResult
193
- );
194
-
195
- progressTracker .endSubTask ("Loading" );
196
-
197
- logLoadingSummary (graphStore );
198
-
199
- return graphStore ;
166
+ try {
167
+ progressTracker .beginSubTask ("Loading" );
168
+ BatchLoadResult nodeCount = new CountingCypherRecordLoader (
169
+ cypherConfig .nodeQuery (),
170
+ CypherRecordLoader .QueryType .NODE ,
171
+ cypherConfig ,
172
+ loadingContext
173
+ ).load (ktx .internalTransaction ());
174
+
175
+ var nodes = new CypherNodeLoader (
176
+ cypherConfig .nodeQuery (),
177
+ nodeCount .rows (),
178
+ cypherConfig ,
179
+ loadingContext ,
180
+ progressTracker
181
+ ).load (ktx .internalTransaction ());
182
+
183
+ var relationshipImportResult = new CypherRelationshipLoader (
184
+ cypherConfig .relationshipQuery (),
185
+ nodes .idMap (),
186
+ cypherConfig ,
187
+ loadingContext ,
188
+ progressTracker
189
+ ).load (ktx .internalTransaction ());
190
+
191
+ var graphStore = createGraphStore (
192
+ nodes ,
193
+ relationshipImportResult
194
+ );
195
+
196
+ progressTracker .endSubTask ("Loading" );
197
+
198
+ logLoadingSummary (graphStore );
199
+
200
+ return graphStore ;
201
+ } catch (RuntimeException ex ) {
202
+ progressTracker .endSubTaskWithFailure ();
203
+ throw ex ;
204
+ }
200
205
});
201
206
}
202
207
0 commit comments