Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
gordielachance committed Jan 26, 2018
1 parent bcb2d6f commit 130a207
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wpsstm-core-sources.php
Expand Up @@ -650,7 +650,8 @@ static function tuneefy_api_aggregate($type,$url_args){
$request_args = null;
$api_response = null;


//TO FIX use a transient to store results for a certain time ?
$token = self::get_tuneefy_token();

if ( is_wp_error($token) ){
Expand Down Expand Up @@ -680,9 +681,8 @@ static function tuneefy_api_aggregate($type,$url_args){
$api_response = json_decode( $body, true );

if( !empty($api_response['errors']) ){
$error_msg = reset($api_response['errors']); //first item
$error_code = key($api_response['errors']);
$error = new WP_Error( 'wpsstm_tuneefy_aggregate', sprintf( __('Unable to aggregate using Tuneefy - %s: %s','wpsstm'),$error_code,$error_msg ) );
$errors = $api_response['errors'];
$error = new WP_Error( 'wpsstm_tuneefy_aggregate', sprintf( __('Unable to aggregate using Tuneefy : %s','wpsstm'),json_encode($errors) ) );
}
}
}
Expand Down

0 comments on commit 130a207

Please sign in to comment.