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

Add Global Exception Handlers with Clearly formatted Error report when API Resource is not Found #78

Open
sprintell opened this issue Feb 18, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@sprintell
Copy link
Member

sprintell commented Feb 18, 2025

Wrong general Error Message is given at the moment "Internal server Error" - e.g - for wrong accession-Id
{
"status": 404,
"error": "Internal Server Error",
"message": "GCST904833779",
"timestamp": "2025-02-18T23:16:22.349Z"
}

A more accurate exception message should Logged and return to API user as below

{
"errorCode": 404,
"error": "Not Found",
"errorMessage": "Studies with Accession Id: GCST904833779 not found",
"servicePath": "http://{server}/gwas/rest/api/v2/studies/GCST904833594",
"timestamp": "2025-02-18T23:07:19"
}

This should be for all endpoints - studies, unpublished-studies, single-nucleotide-polymorphisms, publications, efo-traits, body-of-works, and associations

@sprintell sprintell added the enhancement New feature or request label Feb 18, 2025
@sprintell sprintell self-assigned this Feb 18, 2025
@sprintell
Copy link
Member Author

sprintell commented Feb 19, 2025

Pull request

gwas-rest-api here

And gwasdata-commons here

Fixed for all endpoints below:

Loci Endpoints:
http://hh-rke-wp-webadmin-09-worker-3.caas.ebi.ac.uk:30004/gwas/rest/api/v2/associations/16340910/loci
http://hh-rke-wp-webadmin-09-worker-3.caas.ebi.ac.uk:30004/gwas/rest/api/v2/associations/16344909/loci
http://hh-rke-wp-webadmin-09-worker-3.caas.ebi.ac.uk:30004/gwas/rest/api/v2/associations/163449091/loci/16344909

Publication Endpoints:
http://hh-rke-wp-webadmin-09-worker-3.caas.ebi.ac.uk:30004/gwas/rest/api/v2/publications/292538587

Studies Endpoints:
http://hh-rke-wp-webadmin-09-worker-3.caas.ebi.ac.uk:30004/gwas/rest/api/v2/studies/GCST90038589565
http://hh-rke-wp-webadmin-09-worker-3.caas.ebi.ac.uk:30004/gwas/rest/api/v2/studies/GCST90038589897998/ancestries

Body of Works Endpoints:
http://hh-rke-wp-webadmin-09-worker-3.caas.ebi.ac.uk:30004/gwas/rest/api/v2/body-of-works/GCP00107356
http://hh-rke-wp-webadmin-09-worker-3.caas.ebi.ac.uk:30004/gwas/rest/api/v2/body-of-works/GCP001073x/unpublished-studies

Association Endpoints:
http://hh-rke-wp-webadmin-09-worker-3.caas.ebi.ac.uk:30004/gwas/rest/api/v2/associations/16344909166

SNP Endpoints:
http://hh-rke-wp-webadmin-09-worker-3.caas.ebi.ac.uk:30004/gwas/rest/api/v2/singleNucleotidePolymorphisms/rs1270871645656

Genomic Context Endpoints:
http://hh-rke-wp-webadmin-09-worker-3.caas.ebi.ac.uk:30004/gwas/rest/api/v2/singleNucleotidePolymorphisms/rs12708716866/genomic-contexts
http://hh-rke-wp-webadmin-09-worker-3.caas.ebi.ac.uk:30004/gwas/rest/api/v2/singleNucleotidePolymorphisms/rs127087167/genomic-contexts/149265846899

Unpublished Study Endpoints:
http://hh-rke-wp-webadmin-09-worker-3.caas.ebi.ac.uk:30004/gwas/rest/api/v2/unpublished-studies/GCST904883609

Unpublished Ancestry Endpoints:
http://hh-rke-wp-webadmin-09-worker-3.caas.ebi.ac.uk:30004/gwas/rest/api/v2/unpublished-studies/GCST904883600/unpublished-ancestries
http://hh-rke-wp-webadmin-09-worker-3.caas.ebi.ac.uk:30004/gwas/rest/api/v2/unpublished-studies/GCST90488360/unpublished-ancestries/1643753740

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

No branches or pull requests

1 participant