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

Timeout error - large number of search results #386

Open
shivaramakrishna99 opened this issue Dec 9, 2024 · 2 comments
Open

Timeout error - large number of search results #386

shivaramakrishna99 opened this issue Dec 9, 2024 · 2 comments
Assignees

Comments

@shivaramakrishna99
Copy link
Collaborator

The below error message needs to be replaced with something more human readable:

image
@u8sand
Copy link
Contributor

u8sand commented Dec 9, 2024

Agreed, this comes from: 3d09983#diff-4b206a60e9d28b9a742ac512a5772d4ec5eebb1e0085deed9e833a3067b69518R275

Typically we can log the error to the console but display something else to the user, like: "An error occurred while executing this query, please try again later." or if we handle this specific timeout we can say "Please try to narrow down your search"

@susrinivasan
Copy link
Collaborator

susrinivasan commented Dec 11, 2024

Hi Daniel, We added this to log the error to make it more meaningful. However, we could not test this snippet since we are unable to recreate this error on our branch. Since both our locahost and the production portal are pointing to the same DB server, we assume that this error is due to node.js/npm server timeout. On our instance, it takes about 50 secs to 1 minute to populate the table when we search for cancer and if the timeout threshold is less than that, it probably throws the error. We request you to pull in our changes and we can see whether our new message appears. THanks.

catch (error) {
        console.error("Error fetching C2M2 Main table:", error);
    
        // Check if the error is a timeout error
        if (error instanceof Error && error.message.includes("Timed out")) {
            console.error("Error fetching C2M2 Main table:", error);
            return <div>This error was caused by a timeout. Please narrow down your search.</div>;
        }
    
        // General error handling
        return <div>Error fetching C2M2 Main table: {(error as Error).message}</div>;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants