How can I programmatically get an entity's validation errors? I'm submitting an entity programmatically through a custom, non-entity form. How can I validate the entity before submission, and report the validation errors to the user if they exist?
This code worked for me, not sure if best approach:

    $errors = $my_entity-&gt;validate();
    //see if there were any errors
    if ($errors-&gt;count() == 0) {
      //there are no validation errors, move to next step
      $this-&gt;my_success_action($my_entity)
    }
    else {
      //there were validation errors, report them
      for($j = 0; $j &lt; $errors-&gt;count(); $j++) {
        $error = $errors-&gt;get($j);
        //the entity field that failed validation
        $property = $error-&gt;getPropertyPath().'_my_weird_field_suffix';
        //the error message about how validation failed.
        $message = $error-&gt;getMessage();
        $form_state-&gt;setErrorByName($property, $message);
      }
    }