Quantcast
Channel: User Hubro - Stack Overflow
Viewing all articles
Browse latest Browse all 46

How can I tell PHP to dump exceptions as raw text instead of HTML?

$
0
0

When I'm developing my REST API in PHP I'm working with application/json output, so when I get errors while testing in the browser they look like this:

<b>Fatal error</b>: Uncaught exception 'Exception' with message 'PDO caught an error:array(3) {  [0]=&gt;  string(5) &quot;42000&quot;  [1]=&gt;  int(1065)  [2]=&gt;  string(15) &quot;Query was empty&quot;}

And it gets worse when I get large stack traces and stuff. So is there a flag I can set telling PHP that I want my errors unescaped and in raw text?


Viewing all articles
Browse latest Browse all 46

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>