// $operations contains the operations that remained unprocessed.
$error_operation=reset($operations);
drupal_set_message(t('An error occurred while processing @operation with arguments : @args',['@operation'=>$error_operation[0],'@args'=>print_r($error_operation[0],TRUE)]));
\Drupal::messenger()->addMessage(t('An error occurred while processing @operation with arguments : @args',['@operation'=>$error_operation[0],'@args'=>print_r($error_operation[0],TRUE)]));