@@ -57,22 +57,11 @@ public class SolidClient {
5757 private final Client client ;
5858 private final Headers defaultHeaders ;
5959 private final boolean fetchAfterWrite ;
60- private final JsonService jsonService ;
6160
6261 SolidClient (final Client client , final Headers headers , final boolean fetchAfterWrite ) {
6362 this .client = Objects .requireNonNull (client , "Client may not be null!" );
6463 this .defaultHeaders = Objects .requireNonNull (headers , "Headers may not be null!" );
6564 this .fetchAfterWrite = fetchAfterWrite ;
66-
67- // It is acceptable for a SolidClient instance to be in a classpath without any implementation for
68- // JsonService, in which case the ProblemDetails exceptions will fallback to default and not be parsed.
69- JsonService js ;
70- try {
71- js = ServiceProvider .getJsonService ();
72- } catch (IllegalStateException e ) {
73- js = null ;
74- }
75- this .jsonService = js ;
7665 }
7766
7867 /**
@@ -138,16 +127,10 @@ public <T extends Resource> CompletionStage<T> read(final URI identifier, final
138127 return client .send (request , Response .BodyHandlers .ofByteArray ())
139128 .thenApply (response -> {
140129 if (response .statusCode () >= ERROR_STATUS ) {
141- final ProblemDetails pd = ProblemDetails .fromErrorResponse (
142- response .statusCode (),
143- response .headers (),
144- response .body (),
145- this .jsonService
146- );
147130 throw SolidClientException .handle (
148131 "Unable to read resource at " + request .uri (),
149- pd ,
150132 response .uri (),
133+ response .statusCode (),
151134 response .headers (),
152135 new String (response .body ())
153136 );
@@ -299,16 +282,10 @@ public <T extends Resource> CompletionStage<Void> delete(final T resource, final
299282 if (isSuccess (res .statusCode ())) {
300283 return null ;
301284 } else {
302- final ProblemDetails pd = ProblemDetails .fromErrorResponse (
303- res .statusCode (),
304- res .headers (),
305- res .body (),
306- this .jsonService
307- );
308285 throw SolidClientException .handle (
309286 "Unable to delete resource" ,
310- pd ,
311287 resource .getIdentifier (),
288+ res .statusCode (),
312289 res .headers (),
313290 new String (res .body ())
314291 );
@@ -397,16 +374,10 @@ <T extends Resource> Function<Response<byte[]>, CompletionStage<T>> handleRespon
397374 final Headers headers , final String message ) {
398375 return res -> {
399376 if (!isSuccess (res .statusCode ())) {
400- final ProblemDetails pd = ProblemDetails .fromErrorResponse (
401- res .statusCode (),
402- res .headers (),
403- res .body (),
404- this .jsonService
405- );
406377 throw SolidClientException .handle (
407378 message ,
408- pd ,
409379 resource .getIdentifier (),
380+ res .statusCode (),
410381 res .headers (),
411382 new String (res .body ())
412383 );
0 commit comments