RFR: 1707: Bot warns about "No .jcheck/conf found" when it should not [v5]

Zhao Song zsong at openjdk.org
Tue Dec 6 19:40:17 UTC 2022


On Tue, 6 Dec 2022 18:40:25 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> Zhao Song has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   rename variables
>
> forge/src/main/java/org/openjdk/skara/forge/github/GitHubRepository.java line 276:
> 
>> 274:             }
>> 275:             throw e;
>> 276:         }
> 
> Instead of catching this exception, please use the onError method on the request to register an error handler.

Sorry, I couldn't find a good way to use errorHandler with the current `RestRequest#transformBadResponse`.
We will not be able to return `Optional.empty()` when the error is 404 Not Found.

> forge/src/main/java/org/openjdk/skara/forge/gitlab/GitLabRepository.java line 298:
> 
>> 296:                         // Retry once with additional escaping of the path fragment
>> 297:                         // Only retry when the error is exactly "File Not Found"
>> 298:                         if (response.statusCode() == 404 && response.body().contains("File Not Found")) {
> 
> The comment says 'exactly "File Not Found"' but the conditional uses `.contains`. I think we can switch to `.equals`.

I use contains because the real body is `{"message":"404 File Not Found"}`.  I will use  `response.body().equals("{"message":"404 File Not Found"}")`

-------------

PR: https://git.openjdk.org/skara/pull/1435


More information about the skara-dev mailing list