Welcome Guest, Not a member yet? Register   Sign In
Filter - Return response error
#7

(09-11-2024, 06:25 PM)kenjis Wrote: You seem to misunderstand how PHP or the framework works.

> As a result of the Updater failure, I was expecting, 1) the HTTP 200 response would be sent to the external server (I have received the payload and all is OK), then 2) the Updater class would run and report any subsequent errors in normal manner.

I don't know why you think like that.
The Updater failure just causes 500 response.
If you want to return 200 response, you must return 200 response without any error.

If you want to execute the Updater class after returning 200 response,
you need to use a Queue system like https://queue.codeigniter.com/

Thank you kenjis and ozornick,

My sincere apologies, I completely understand how PHP and HTTP work, however, I was convinced I read somewhere in the documantation that an After filter would run after a controller has executed and the page had been rendered. Thus, my confusion as to why the HTTP response was not returning as expected.

Obviously this is not the case !!!

I will take a look at implmenting queues.

Thank you.
Reply


Messages In This Thread
Filter - Return response error - by 68thorby68 - 08-26-2024, 03:54 AM
RE: Filter - Return response error - by seunex - 08-26-2024, 03:04 PM
RE: Filter - Return response error - by kenjis - 08-26-2024, 03:46 PM
RE: Filter - Return response error - by ozornick - 09-11-2024, 06:37 AM
RE: Filter - Return response error - by kenjis - 09-11-2024, 06:25 PM
RE: Filter - Return response error - by 68thorby68 - 09-13-2024, 09:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB