Skip to content

Commit

Permalink
udpates from feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
indiepopart committed May 31, 2024
1 parent 17205ef commit 9addf9b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions _source/_posts/2024-04-30-spring-api-fga.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public class AuthorizationService {
._object("document:" + permission.getDocumentId());
ClientWriteResponse response = fgaClient.writeTuples(List.of(tuple)).get();
} catch (FgaInvalidParameterException | InterruptedException | ExecutionException e) {
throw new AuthorizationServiceException(e);
throw new AuthorizationServiceException("Unexpected error", e);
}
}
}
Expand All @@ -270,6 +270,10 @@ public class AuthorizationServiceException extends RuntimeException {
public AuthorizationServiceException(Exception e) {
super(e);
}

public AuthorizationServiceException(String message, Exception e) {
super(message, e);
}
}
```

Expand Down Expand Up @@ -429,7 +433,6 @@ In the previous section, you created an authorization model and converted it to
// src/main/java/com/example/demo/initializer/OpenFGAUtil.java
package com.example.demo.initializer;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import dev.openfga.sdk.api.model.AuthorizationModel;
import org.slf4j.Logger;
Expand Down Expand Up @@ -464,8 +467,6 @@ public class OpenFGAUtil {
AuthorizationModel authorizationModel = objectMapper.readValue(json, AuthorizationModel.class);
logger.debug(authorizationModel.toString());
return authorizationModel;
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit 9addf9b

Please sign in to comment.