Currently, whenever an upstream service is down, kong will throw "{"message":"failure to get a peer from the ring-balancer"}"
I am trying to create a custom plugin that detects the connection time out and return a customized message to the client, the blocker I am facing right now is writing lua codes in my custom plugin to detect the timeout. I have tried using
if(kong.response.get_source() == "error")
but that does not seem to detect timeout either.
Does anyone have any idea what I should do to detect connection timeout in when writing a custom kong plugin?