Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Should capture the error message after the error occurs in reply() in core.conversation.py #216

Closed
jkshj21 opened this issue Aug 16, 2024 · 0 comments · Fixed by #240 or #233
Closed
Assignees
Labels
enhancement New feature or request Error Handling fr Feature Request sessions Relating to DFCX Sessions Class

Comments

@jkshj21
Copy link
Collaborator

jkshj21 commented Aug 16, 2024

Is your proposal related to a problem?

Problem:
Whenever we are running the end to end test using reply function or running the nlu test using intent_detection function, it would be good if it captures the error message and indicate it to the user.

Solution:
when either 4xx (Client error) or 5xx (internal error) error occurs, instead of passing an empty dictionary, we should pass the error data that specifies the error message to quality check the agent behavior.

` try:
response = session_client.detect_intent(request=request)

    except core_exceptions.InternalServerError as err:
        logging.error(
            "---- ERROR --- InternalServerError caught on CX.detect %s", err
        )
        logging.error("text: %s", text)
        logging.error("query_params: %s", query_params)
        logging.error("query_input: %s", query_input)
        return {}

    except core_exceptions.ClientError as err:
        logging.error(
            "---- ERROR ---- ClientError caught on CX.detect %s", err
        )
        template = "An exception of type {0} occurred. \nArguments:\n{1!r}"
        message = template.format(type(err).__name__, err.args)
        logging.error("err name %s", message)

        logging.error("text %s", text)
        logging.error("query_params %s", query_params)
        logging.error("query_input %s", query_input)
        logging.error(traceback.print_exc())
        retries += 1
        if retries < MAX_RETRIES:
            logging.error("retrying")
            return self.reply(send_obj, restart=restart, retries=retries)
        else:
            logging.error("MAX_RETRIES exceeded")
            return {}

`

@jkshj21 jkshj21 added enhancement New feature or request fr Feature Request labels Aug 16, 2024
@jkshj21 jkshj21 self-assigned this Aug 16, 2024
@kmaphoenix kmaphoenix added sessions Relating to DFCX Sessions Class Error Handling labels Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Error Handling fr Feature Request sessions Relating to DFCX Sessions Class
Projects
None yet
2 participants