Code Duplication    Length = 4-9 lines in 2 locations

class.jetpack-cli.php 2 locations

@@ 121-124 (lines=4) @@
118
			Jetpack_Client::WPCOM_JSON_API_VERSION
119
		);
120
121
		if ( is_wp_error( $response ) ) {
122
			/* translators: %1$s is the error code, %2$s is the error message */
123
			WP_CLI::error( sprintf( __( 'Failed to test connection (#%1$s: %2$s)', 'jetpack' ), $response->get_error_code(), $response->get_error_message() ) );
124
		}
125
126
		$body = wp_remote_retrieve_body( $response );
127
		if ( ! $body ) {
@@ 1101-1109 (lines=9) @@
1098
			$named_args['base_api_path']
1099
		);
1100
1101
		if ( is_wp_error( $response ) ) {
1102
			WP_CLI::error( sprintf(
1103
				/* translators: %1$s is an endpoint route (ex. /sites/123456), %2$d is an error code, %3$s is an error message. */
1104
				__( 'Request to %1$s returned an error: (%2$d) %3$s.', 'jetpack' ),
1105
				$resource_url,
1106
				$response->get_error_code(),
1107
				$response->get_error_message()
1108
			) );
1109
		}
1110
1111
		if ( 200 !== wp_remote_retrieve_response_code( $response ) ) {
1112
			WP_CLI::error( sprintf(