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
|
@@ 119-125 (lines=7) @@
|
116 |
|
|
117 |
|
$token = $this->get_token( $data ); |
118 |
|
|
119 |
|
if ( is_wp_error( $token ) ) { |
120 |
|
$code = $token->get_error_code(); |
121 |
|
if ( empty( $code ) ) { |
122 |
|
$code = 'invalid_token'; |
123 |
|
} |
124 |
|
return new Jetpack_Error( $code, $token->get_error_message(), 400 ); |
125 |
|
} |
126 |
|
|
127 |
|
if ( ! $token ) { |
128 |
|
return new Jetpack_Error( 'no_token', 'Error generating token.', 400 ); |