Action server exception handling

I want to know about way to handle exception when action server is not running. I want to tell user to wait or a error. Please tell me any suggestion.

If the action server is not running and Rasa is trying to run a custom action, it will receive an error that is catched here: rasa/action.py at master · RasaHQ/rasa · GitHub. Finally, the raised exception will be catched here: rasa/processor.py at master · RasaHQ/rasa · GitHub. No action is executed and no event is added to the tracker. We just log the error.

So, unfortunately you cannot catch the error and handle it differently.

I am getting multiple responses from Facebook messenger when my server starts from off. Can I handle the requests in Rasa. I think it sending multiple requests when server is starting that’s why gives multiple responses.

What request are you talking about? As far as I know we only handle incoming user messages from Facebook. We ignore other messages.The incoming messages are processed and a respond is send via the Facebook channel. However, if you want to handle more messages, you can adapt the existing Facebook Connector to handle more messages (Custom Connectors).

I am talking about response that we give back to Facebook. So tell me I can control it or not. I think it is more related to how internet works like GET and POST. Just tell is there is any way to control responses. If any…

Hi @im-singh, can you post some screenshots of what your issue is?

@Tanja @erohmensing, I want to handle the exceptions for API calls in rasa action server. For example, In the rasa action server, I host a local server for API call. If the server is Not Found, I have to respond the user that the requested server is not found and I want to respond the user to make a valid request. Could you give some information on this?

I have tried to implement this using requests.status_code and throw a message in the action server. But, I want to send the message as a response while interacting to the user in the rasa server

 if r.status_code == 200:
    process_message = "The client request has succeeded"
    logger.info(process_message)

for which, The output is

127.0.0.1 - - [2019-10-29 12:39:25] “POST /webhook HTTP/1.1” 200 169 0.030977

127.0.0.1 - - [2019-10-29 12:39:37] “POST /webhook HTTP/1.1” 200 226 0.001980

2019-10-29 12:39:38 INFO root - The client request has succeeded

{‘Addr’: None, ‘Area’: ‘centre’, ‘Day’: None, ‘Food’: ‘italian’, ‘Name’: None, ‘People’: None, ‘Phone’: None, ‘Post’: None, ‘Price’: None, ‘none’: None}

2019-10-29 12:39:38 ERROR rasa_sdk.executor - Your action’s ‘Action-Search’ run method returned an invalid event. Event will be ignored. Event: ‘None’.

2019-10-29 12:39:38 ERROR rasa_sdk.executor - Your action’s ‘Action-Search’ run method returned an invalid event. Event will be ignored. Event: ‘15’.

Hi!

This is an old post, but does anyone have any updates regarding this?