title: Detect if an exception has been thrown manually without using a custom exception class
body: <p>I got a <code>try-catch</code> block in my php application like this:</p>
  
  <pre><code>try {
    if ($userForgotToEnterField) {
       throw new Exception('You need to fill in your name!');
    }
    ...
    doDifferentThingsThatCanThrowExceptions();
    ...
  } catch (ExpectedException $e) {
    $template-&gt;setError('A database error occured.');
  } catch (Exception $e) {
    $template-&gt;setError($e-&gt;getMessage());
  }
  </code></pre>
  
  <p>I would like to only output <code>$e-&gt;getMessage()</code> for the exceptions I have manually thrown with a custom error text and not the ones that have been thrown by the other code as these might contain sensitive information or very technical info that the user should not see.</p>
  
  <p>Is it possible to differentiate from a manually thrown exception and a random exception thrown by some method without using a custom exception class?</p>