title: How to show only extracted error message from Custom Validation on a Visualforce Page?
body: <p>I have added few custom validations using Configuration for an object. I am inserting that object record through visualforce page. I have added <code>&lt;apex:pageMessages/&gt;</code> on my visualforce page. I have also written code block for catching the exception and to show the error message ob VF page. Please find code block below : </p>
  
  <pre><code>catch(DMLException excp)
  {
      ApexPages.Message msg = new ApexPages.Message(Apexpages.Severity.ERROR, excp.getMessage() );
      ApexPages.addMessage(msg);  
      return null;                            
  } 
  </code></pre>
  
  <p>Still I am not able to get only error message from the custom validation. It shows me error like below : </p>
  
  <blockquote>
    <p>Insert failed. First exception on row 0; first error:
    FIELD_CUSTOM_VALIDATION_EXCEPTION, 
    <strong>error_message_from_custom_validation_comes_here</strong></p>
  </blockquote>
  
  <p>Is there any solution for this?</p>