ask_sdk_runtime.exceptions.DispatchException: Unable to find a suitable request handler

1.1k views Asked by At

I'm developing my first skill with alexa and i'm using slots, but I have a little problem when it comes to the slots response. and I have the error ask_sdk_runtime.exceptions.DispatchException: Unable to find a suitable request handler how can I solve?

this is the error

2

There are 2 answers

0
Johannes Krämer On

I would recommend to add a RequestInterceptor to log all your incoming requests. This way you can find out which type of request is causing the trouble.

Example code:

class LogRequestInterceptor(AbstractRequestInterceptor):
    def process(self, handler_input):
        logger.info(f"Request type: {handler_input.request_envelope.request.object_type}")

then add it to your skill builder as with the other handlers: sb.add_global_request_interceptor(LogRequestInterceptor())

Python AbstractRequestInterceptor docs: https://alexa-skills-kit-python-sdk.readthedocs.io/en/latest/api/core.html?highlight=requestinterceptor#ask_sdk_core.dispatch_components.request_components.AbstractRequestInterceptor

0
selmanioui On

I've had the same issue, I fixed it by adding a request handler for the class that handles the intent that I invoke.

Here's the solution : add the following at the end of your lambda_function file, which basically just calls the class that handles the intent(you must create one if you haven't).

sb.add_request_handler(THE_NAME_OF_THE_CLASS_THAT_HANDLES_THE_INTENT())