I throw new Exception when I can catch a failure and do something about it. If I can't do something about it then I just trigger_error().
Now there's something new to me in PHP 7: throw new Error.
E.g.,
if (!mail(...))
throw new Error('...');
or
if (!mail(...))
trigger_error('...');
If I don't want to catch the error or do something in case mail() fails should I use throw new Error() or just the plain old trigger_error()?
What instances should we use throw new Error() vs a simple trigger_error()?