Welcome Guest, Not a member yet? Register   Sign In
how to throw exception that returns 400 HTTP response code
#2

(This post was last modified: 02-18-2023, 06:40 PM by kenjis.)

Implement an Exception class that implements HTTPExceptionInterface, and set the error code 400.
And throw it.

I think this is not good, but try:
PHP Code:
throw new class ('BAD REQUEST'400) extends \Exception implements \CodeIgniter\Exceptions\HTTPExceptionInterface {}; 
Reply


Messages In This Thread
RE: how to throw exception that returns 400 HTTP response code - by kenjis - 02-18-2023, 06:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB