Skip to content

Create proper reindex/push settings responses for AJAX based events. #453

@tw2113

Description

@tw2113

In both re_index() and push_settings() methods from Algolia_Admin class, we return wp_send_json() responses for successful try/catch instances. However, if we do end up in the catch portion, we just do echo esc_html( $exception->getMessage() ) and then throw the exception up the chain.

While I'm not presently sure about throwing the exception further, we should probably amend the sections to do:

wp_send_json(
    [
        'responseText' => $exception->getMessage()
    ]
);

that way the alert gets the proper values to show.

Metadata

Metadata

Assignees

No one assigned

    Labels

    has PRHas changes ready for reviewindexingIssues around the indexing process

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions