title: Providing a more meaningful message when an error is raised in PL/SQL
body: <p>Suppose I have a PL/SQL function that selects one value from a table. If the query returns no records, I wish for the <code>NO_DATA_FOUND</code> error to propagate (so that the calling code can catch it), but with a more meaningful error message when <code>SQLERRM</code> is called.</p>
  
  <p>Here is an example of what I am trying to accomplish:</p>
  
  <pre><code>FUNCTION fetch_customer_id(customer_name VARCHAR2) RETURN NUMBER;
      customer_id NUMBER;
  BEGIN
      SELECT customer_id
        INTO customer_id
        FROM CUSTOMERS
       WHERE customer_name = fetch_customer_id.customer_name;
  
      RETURN customer_id;
  EXCEPTION
      WHEN NO_DATA_FOUND THEN
          meaningful_error_message := 'Customer named ' || customer_name || ' does not exist';
          RAISE;
  END;
  </code></pre>
  
  <p>Is there a way to associate <code>meaningful_error_message</code> with the <code>NO_DATA_FOUND</code> error?</p>
  
  <p><strong>Update:</strong> It has been suggested that I use <code>RAISE_APPLICATION_ERROR</code> to raise a custom error code when <code>NO_DATA_FOUND</code> is encountered. The purpose of this question was to determine if this technique could be avoided so that the calling code can catch <code>NO_DATA_FOUND</code> errors rather than a custom error code. Catching <code>NO_DATA_FOUND</code> seems more semantically correct, but I could be wrong.</p>