projects/packages/connection/src/class-xmlrpc-connector.php 1 location
                
                
                    
                                                
                                                    
                                |  | @@ 66-76 (lines=11) @@ | 
                                                            
                                    | 63 |  | 	 * @param mixed $data The data to output. | 
                                                            
                                    | 64 |  | 	 */ | 
                                                            
                                    | 65 |  | 	private function output( $data ) { | 
                                                            
                                    | 66 |  | 		if ( is_wp_error( $data ) ) { | 
                                                            
                                    | 67 |  | 			$code = $data->get_error_data(); | 
                                                            
                                    | 68 |  | 			if ( ! $code ) { | 
                                                            
                                    | 69 |  | 				$code = -10520; | 
                                                            
                                    | 70 |  | 			} | 
                                                            
                                    | 71 |  |  | 
                                                            
                                    | 72 |  | 			return new \IXR_Error( | 
                                                            
                                    | 73 |  | 				$code, | 
                                                            
                                    | 74 |  | 				sprintf( 'Jetpack: [%s] %s', $data->get_error_code(), $data->get_error_message() ) | 
                                                            
                                    | 75 |  | 			); | 
                                                            
                                    | 76 |  | 		} | 
                                                            
                                    | 77 |  |  | 
                                                            
                                    | 78 |  | 		return $data; | 
                                                            
                                    | 79 |  | 	} | 
                                                                        
                 
                                                            
                    
projects/packages/connection/src/class-manager.php 1 location
                
                
                    
                                                
                                                    
                                |  | @@ 1873-1879 (lines=7) @@ | 
                                                            
                                    | 1870 |  |  | 
                                                            
                                    | 1871 |  | 		$token = $this->get_tokens()->get( $data, $this->api_url( 'token' ) ); | 
                                                            
                                    | 1872 |  |  | 
                                                            
                                    | 1873 |  | 		if ( is_wp_error( $token ) ) { | 
                                                            
                                    | 1874 |  | 			$code = $token->get_error_code(); | 
                                                            
                                    | 1875 |  | 			if ( empty( $code ) ) { | 
                                                            
                                    | 1876 |  | 				$code = 'invalid_token'; | 
                                                            
                                    | 1877 |  | 			} | 
                                                            
                                    | 1878 |  | 			return new \WP_Error( $code, $token->get_error_message(), 400 ); | 
                                                            
                                    | 1879 |  | 		} | 
                                                            
                                    | 1880 |  |  | 
                                                            
                                    | 1881 |  | 		if ( ! $token ) { | 
                                                            
                                    | 1882 |  | 			return new \WP_Error( 'no_token', 'Error generating token.', 400 ); |