@@ -722,22 +722,21 @@ public void onTableArrayParse(String key, JSONArray valueArray) throws Exception
722
722
if (failedCount > 0 ) {
723
723
allResult .put ("failedCount" , failedCount );
724
724
allResult .put ("failedIdList" , failedIds );
725
- if (firstFailThrow != null ) {
726
- if (firstFailThrow instanceof CommonException && firstFailThrow .getCause () != null ) {
727
- firstFailThrow = firstFailThrow .getCause ();
728
- }
729
725
730
- JSONObject failObj = new JSONObject (true );
731
- failObj .put ("index" , firstFailIndex );
732
- failObj .put (childKey , firstFailReq );
726
+ JSONObject failObj = new JSONObject (true );
727
+ failObj .put ("index" , firstFailIndex );
728
+ failObj .put (childKey , firstFailReq );
733
729
734
- JSONObject obj = AbstractParser .extendErrorResult (failObj , firstFailThrow , parser .isRoot ());
735
- if (Log .DEBUG ) {
736
- obj .put ("trace:throw" , firstFailThrow .getClass ().getName ());
737
- obj .put ("trace:stack" , firstFailThrow .getStackTrace ());
738
- }
739
- allResult .put ("firstFailed" , obj );
730
+ if (firstFailThrow instanceof CommonException && firstFailThrow .getCause () != null ) {
731
+ firstFailThrow = firstFailThrow .getCause ();
740
732
}
733
+ JSONObject obj = firstFailThrow == null ? failObj : AbstractParser .extendErrorResult (failObj , firstFailThrow , parser .isRoot ());
734
+ if (Log .DEBUG && firstFailThrow != null ) {
735
+ obj .put ("trace:throw" , firstFailThrow .getClass ().getName ());
736
+ obj .put ("trace:stack" , firstFailThrow .getStackTrace ());
737
+ }
738
+
739
+ allResult .put ("firstFailed" , obj );
741
740
}
742
741
allResult .put (JSONResponse .KEY_COUNT , allCount );
743
742
allResult .put (idKey + "[]" , ids );
0 commit comments