-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] How to capture 403 response from generated APIClient (java/webclient) #12809
Comments
@rocb usually there are additional methods with public Mono<ResponseEntity<Datasources>> reportsGetDatasourcesInGroupWithHttpInfo(UUID workspaceId, UUID reportId) {
..
} I believe you can use this method to extract status code from that |
@borsch Wow.... you are correct, I did not notice that method. After giving it a try, it behaves the same. It will simply hang on 403, any other response (like 404) can get an exception.
I am able to catch a 404. But a 403 just hangs on .block()
So, for now, I am gonna put in a Duration timeout in.. .block(5) and assume it is a 403 (not really a solution) |
Hi @rocb Hope this will help you |
@rocb try latest master |
I generated a client using generatorName java and library webclient. The generate api client works the service side REST api returns success. But when I get a HTTP 403 response, the block() call just hangs.
Code is like this:
ReportsApi reportApi = new ReportsApi();
Mono rsp = reportApi.reportsGetDatasourcesInGroup(UUID.fromString(workspaceId), UUID.fromString(reportId));
Datasources ds= rsp.block();
I attempt to add .onErrorMap() and other on the Mono object, with no luck.
I know why I am getting 403 from the server, but I just need to be able to capture it in code so I can do the appropriate.
The text was updated successfully, but these errors were encountered: