Skip to content

Commit

Permalink
exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverSchlueter committed Nov 23, 2024
1 parent 12ac7a7 commit d0fd7e1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/main/java/de/oliver/fancynpcs/skins/SkinManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import java.io.File;
import java.net.MalformedURLException;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
Expand Down Expand Up @@ -229,10 +228,15 @@ private SkinInfo executeRequest(GenerateRequest req) {

if (throwable instanceof MineSkinRequestException requestException) {
MineSkinResponse<?> response = requestException.getResponse();
Optional<CodeAndMessage> detailsOptional = response.getErrorOrMessage();
detailsOptional.ifPresent(details -> {
FancyNpcs.getInstance().getFancyLogger().warn("Could not fetch skin: " + details.code() + ": " + details.message());
});

for (CodeAndMessage error : response.getErrors()) {
FancyNpcs.getInstance().getFancyLogger().warn("Could not fetch skin: " + error.code() + ": " + error.message());
}

// Optional<CodeAndMessage> detailsOptional = response.getErrorOrMessage();
// detailsOptional.ifPresent(details -> {
// FancyNpcs.getInstance().getFancyLogger().warn("Could not fetch skin: " + details.code() + ": " + details.message());
// });
}
return null;
});
Expand Down

0 comments on commit d0fd7e1

Please sign in to comment.