packages/connection/src/XMLRPC_Connector.php 1 location
                
                
                    
                                                
                                                    
                                |  | @@ 65-75 (lines=11) @@ | 
                                                            
                                    | 62 |  | 	 * @param mixed $data The data to output. | 
                                                            
                                    | 63 |  | 	 */ | 
                                                            
                                    | 64 |  | 	private function output( $data ) { | 
                                                            
                                    | 65 |  | 		if ( is_wp_error( $data ) ) { | 
                                                            
                                    | 66 |  | 			$code = $data->get_error_data(); | 
                                                            
                                    | 67 |  | 			if ( ! $code ) { | 
                                                            
                                    | 68 |  | 				$code = -10520; | 
                                                            
                                    | 69 |  | 			} | 
                                                            
                                    | 70 |  |  | 
                                                            
                                    | 71 |  | 			return new \IXR_Error( | 
                                                            
                                    | 72 |  | 				$code, | 
                                                            
                                    | 73 |  | 				sprintf( 'Jetpack: [%s] %s', $data->get_error_code(), $data->get_error_message() ) | 
                                                            
                                    | 74 |  | 			); | 
                                                            
                                    | 75 |  | 		} | 
                                                            
                                    | 76 |  |  | 
                                                            
                                    | 77 |  | 		return $data; | 
                                                            
                                    | 78 |  | 	} | 
                                                                        
                 
                                                            
                    
class.jetpack-client-server.php 1 location
                
                
                    
                                                
                                                    
                                |  | @@ 115-121 (lines=7) @@ | 
                                                            
                                    | 112 |  |  | 
                                                            
                                    | 113 |  | 		$token = $this->get_token( $data ); | 
                                                            
                                    | 114 |  |  | 
                                                            
                                    | 115 |  | 		if ( is_wp_error( $token ) ) { | 
                                                            
                                    | 116 |  | 			$code = $token->get_error_code(); | 
                                                            
                                    | 117 |  | 			if ( empty( $code ) ) { | 
                                                            
                                    | 118 |  | 				$code = 'invalid_token'; | 
                                                            
                                    | 119 |  | 			} | 
                                                            
                                    | 120 |  | 			return new Jetpack_Error( $code, $token->get_error_message(), 400 ); | 
                                                            
                                    | 121 |  | 		} | 
                                                            
                                    | 122 |  |  | 
                                                            
                                    | 123 |  | 		if ( ! $token ) { | 
                                                            
                                    | 124 |  | 			return new Jetpack_Error( 'no_token', 'Error generating token.', 400 ); |