@@ -154,19 +154,23 @@ private void createTests() throws AqualityException {
154
154
List <TestDto > completedTests = new ArrayList <>();
155
155
156
156
for (TestDto test : this .tests ) {
157
- test .setProject_id (this .projectId );
158
- TestDto existingTest = tryGetExistingTest (allTests , test );
159
-
160
- if (existingTest != null ) {
161
- test .setId (existingTest .getId ());
162
- } else {
163
- allTests .add (test );
164
- }
157
+ try {
158
+ test .setProject_id (this .projectId );
159
+ TestDto existingTest = tryGetExistingTest (allTests , test );
160
+
161
+ if (existingTest != null ) {
162
+ test .setId (existingTest .getId ());
163
+ } else {
164
+ allTests .add (test );
165
+ }
165
166
166
- test .setId (controllerFactory .getHandler (test ).create (test , false ).getId ());
167
- linkTestToSuite (test );
167
+ test .setId (controllerFactory .getHandler (test ).create (test , false ).getId ());
168
+ linkTestToSuite (test );
168
169
169
- completedTests .add (test );
170
+ completedTests .add (test );
171
+ } catch (AqualityException exception ) {
172
+ logToImport (String .format ("Was not able to create or update test:\n %s\n Creation was failed with error:\n %s" , test .getName (), exception .getMessage ()));
173
+ }
170
174
}
171
175
this .tests = completedTests ;
172
176
@@ -207,9 +211,10 @@ private void createResult(TestResultDto result, boolean update) throws AqualityE
207
211
}
208
212
controllerFactory .getHandler (result ).create (result );
209
213
} catch (AqualityException e ){
210
- throw e ;
211
- } catch (Exception e ){
212
- throw new AqualityException ("Failed on Result Creation for test id: " + result .getTest_id ());
214
+ logToImport (
215
+ String .format ("Failed on Result Creation for test id:\n %s\n Creation was failed with error:\n %s" ,
216
+ result .getTest_id (),
217
+ e .getMessage ()));
213
218
}
214
219
}
215
220
@@ -246,7 +251,10 @@ private void updateResultWithSimilarError(TestResultDto result) throws AqualityE
246
251
}
247
252
}
248
253
} catch (Exception e ){
249
- throw new AqualityException ("Failed on update Result with similar error" );
254
+ logToImport (
255
+ String .format ("Failed on predicting fail reason for test id:\n %s\n Prediction was failed with error:\n %s" ,
256
+ result .getTest_id (),
257
+ e .getMessage ()));
250
258
}
251
259
}
252
260
0 commit comments