Skip to content

Commit

Permalink
[MNG-6869] Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
mthmulders committed Feb 23, 2023
1 parent 9630d87 commit 45ba62e
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 52,7 @@ public Optional<String> verifyConnectionToRemoteRepository(

try {
final Transporter transporter = transporterProvider.newTransporter(session, repository);
final Optional<String> issue = verifyConnectionUsingTransport(transporter, repository);

if (!issue.isPresent()) {
logger.info(
"Connection check for repository '{}' at '{}' completed",
repository.getId(),
repository.getUrl());
}

return issue;
return verifyConnectionUsingTransport(transporter, repository);
} catch (final NoTransporterException nte) {
final String message = String.format(
"There is no compatible transport for remote repository '%s' with location '%s'",
Expand All @@ -76,6 67,10 @@ private Optional<String> verifyConnectionUsingTransport(
final GetTask task = new GetTask(URI.create(""));
transporter.get(task);
// We could connect, but uncertain to what. Could be the repository, could be a valid web page.
logger.info(
"Connection check for repository '{}' at '{}' completed",
remoteRepository.getId(),
remoteRepository.getUrl());
return Optional.empty();
} catch (final Exception e) {
final int errorOrArtifactNotFound = transporter.classify(e);
Expand Down

0 comments on commit 45ba62e

Please sign in to comment.