| @@ -149,15 +149,15 @@ | ||
| 149 | 149 | * |
| 150 | 150 | * @throws API_Exception |
| 151 | 151 | */ |
| 152 | 152 | public function parse_response( $response ) { |
| 153 | - // test for wp errors (request failures) | |
| 154 | - if( $response instanceof WP_Error) { | |
| 153 | + // test for wp errors | |
| 154 | + if( $response instanceof WP_Error) { | |
| 155 | 155 | throw new API_Exception( $response->get_error_message() ); |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | // retrieve response body |
| 159 | - $body = wp_remote_retrieve_body( $response ); | |
| 159 | + $body = wp_remote_retrieve_body( $response ); | |
| 160 | 160 | $json = json_decode( $body ); |
| 161 | 161 | if( ! is_object( $json ) ) { |
| 162 | 162 | throw new API_Exception( __( "The Boxzilla server returned an invalid response.", 'boxzilla' ) ); |
| 163 | 163 | } |
| @@ -170,5 +170,5 @@ | ||
| 170 | 170 | // return actual response data |
| 171 | 171 | return $json->data; |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | -} | |
| 174 | +} | |