Skip to content

Commit

Permalink
feat: Add user-friendly error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Dec 8, 2023
1 parent 3a9d7c3 commit 4c14f05
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions convertPheno_client/src/code/utils/errorMessages.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const errorMessages = {
"TypeError: Cannot read properties of undefined (reading 'map')": "An unexpected error occurred while processing your data. Please try again.",
"Error: Request failed with status code 404": "The requested resource could not be found. Please check your input and try again.",
"Error: Network Error": "A network error occurred. Please check your internet connection and try again."
};

export function getFriendlyErrorMessage(errorMessage) {
return errorMessages[errorMessage] || "An unexpected error occurred. Please try again.";
}

0 comments on commit 4c14f05

Please sign in to comment.