Skip to content

Commit

Permalink
Add exception cause to JsonDeserializer
Browse files Browse the repository at this point in the history
  • Loading branch information
fvolz committed Jan 21, 2025
1 parent 7dcabc5 commit bfd0fda
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import de.fraunhofer.iosb.model.aas.AasProvider;
import okhttp3.Response;
import okhttp3.ResponseBody;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DeserializationException;
import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonDeserializer;
import org.eclipse.edc.spi.result.Result;
Expand Down Expand Up @@ -97,7 +98,7 @@ private Result<Response> executeRequest(AasDataProcessor processor, AasDataAddre
return Result.success(Optional.ofNullable(jsonDeserializer.readList(responseJson, clazz))
.orElse(new ArrayList<>()));
} catch (JsonProcessingException | DeserializationException e) {
return Result.failure(List.of("Failed parsing list of %s".formatted(clazz.getName()), e.getMessage()));
return Result.failure(List.of("Failed parsing list of %s".formatted(clazz.getName()), e.getMessage(), ExceptionUtils.getRootCauseMessage(e)));
}
}
}

0 comments on commit bfd0fda

Please sign in to comment.