Skip to content

Commit

Permalink
Handle 404 status when generating signature
Browse files Browse the repository at this point in the history
  • Loading branch information
amvanbaren committed Mar 21, 2024
1 parent 58d9eb4 commit 651851b
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import org.springframework.web.client.HttpClientErrorException;

@Component
@ConditionalOnProperty(value = "ovsx.data.mirror.enabled", havingValue = "false", matchIfMissing = true)
Expand Down Expand Up @@ -76,6 +78,12 @@ public void run(MigrationJobRequest jobRequest) throws Exception {

migrations.uploadFileResource(signature);
migrations.persistFileResource(signature);
} catch (HttpClientErrorException e) {
if(e.getStatusCode() == HttpStatus.NOT_FOUND) {
logger.warn("Could not find extension file for: {}", NamingUtil.toLogFormat(extVersion));
} else {
throw e;
}
}
}
}

0 comments on commit 651851b

Please sign in to comment.