I’m using throw new Exception(...) to handle errors, but these errors are huge! With 7 stack traces I get a 5 line error.
Let’s say I call for a property that doesn’t exist. I want to simply display the property X doesn't exist message, and the location where it was called: in file.php, line Y
Is that possible?
I assume you simply want this for your own personal debugging. You could do a few things:
a) Learn how to read the exception errors
b) Create an exception handler and only output a few things:
Reference the docs to see what information is available.
c) Use an extension like xdebug that already provides a pretty exception handler