dazziola
dazziola

Reputation: 193

Is there a way to stop Stack traces from being output with an Exception error?

I want to stop Stack Traces from appearing in my fatal errors in PHP.

My PHP code:

throw new ErrorException('Failed here!', 10);

Results in:

Fatal error: Uncaught exception 'ErrorException' with message 'Failed here!' in C:\file\path\File.php:25 Stack trace: #0 C:\xampp\htdocs\sample-integrations\site-folder\index.php(18): Realex\Transaction::create(Array) #1 {main} thrown in C:\file\path\File.php on line 25

being output in the browser. How can I remove the stack trace?

Upvotes: 1

Views: 2687

Answers (1)

Owen O Byrne
Owen O Byrne

Reputation: 417

This may have been answered by this https://stackoverflow.com/a/17766961/400114? Use the xdebug_disable() function in the XDebug extension.

Not ideal, but might do the trick!

Upvotes: 0

Related Questions