Skip to content

Commit 5148284

Browse files
committed
Handle 404 from GitHub API
1 parent 6d50f4d commit 5148284

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/WP_CLI/CommandWithUpgrade.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,13 @@ protected function get_the_latest_github_version( $repo_slug ) {
893893
);
894894
}
895895

896+
if ( 404 === wp_remote_retrieve_response_code( $response ) ) {
897+
return new \WP_Error(
898+
$decoded_body->status,
899+
$decoded_body->message
900+
);
901+
}
902+
896903
if ( null === $decoded_body ) {
897904
return new \WP_Error( 500, 'Empty response received from GitHub.com API' );
898905
}

0 commit comments

Comments
 (0)