I want to be able to "make" browser display errors, like forbidden, 503 etc…
Is there some kind of sandbox where I could do this?
I need the errors to be rendered in google chrome, then take a screen capture of browser window.
Something like image under it, but force the browser to display something like this, maybe in Chrome dev tools could be done?
2
Answers
You can do this with try-catch condition and set_exception_handler function like this:
For more information you may visit site https://netgen.io/blog/modern-error-handling-in-php
You can simply use
try
andcatch
, you can check function insidetry
and throw error tocatch
.For example, I need to run MySQL if is there any error then report it.
So here is function for it:
The
$e
inside catch will give you error.