0
To perform a system validation I need to create an error status and get this status
in ajax in:
error: (function (erro) {
//codigo
})
Based on http_response_code(404);
of PHP
.
I can make a mistake 603
and get this mistake 603
on the return of the ajax ?
I tried to change/include the status 603
in http_response_code("603");
but on the return of the ajax, I obtained the code 500
What is the need for the specific error? The existing codes do not solve it?
– Gabriel Heming
The need is for internal system handling. For example, adding a debtor, without adding a contract, generates error. And for each error, there is a specific message to be displayed.
– Wagner Fillio
http://php.net/manual/en/function.http-response-code.php#114996
– Gabriel Heming
I’ve read about it, but haven’t found how I can include an error status
– Wagner Fillio
This is exactly what it says on the link, any code that is not an error of the indicated list, will be changed to a standard answer (200 or 500). Maybe use the function
header
directly. http://php.net/manual/en/function.http-response-code.php#107261– Gabriel Heming
That’s right!
– Wagner Fillio